initial
This commit is contained in:
commit
74ae93a96e
1 changed files with 94691 additions and 0 deletions
|
|
@ -0,0 +1,25 @@
|
|||
ternary operator for routing
|
||||
|
||||
When using `{}` for js expression make sure to wrap in under any component or element whether it is empty like `<> </>`
|
||||
|
||||
```jsx
|
||||
|
||||
const [route,setRoute]=useState('home')
|
||||
return (
|
||||
<>
|
||||
{route === "home" ? (
|
||||
<div className="App">
|
||||
<Nav />
|
||||
<Article
|
||||
files={files}
|
||||
setFiles={setFiles}
|
||||
category={category}
|
||||
setCategory={setCategory}
|
||||
/>
|
||||
</div>
|
||||
) : (
|
||||
<Output />
|
||||
)}
|
||||
</>
|
||||
);
|
||||
```
|
||||
Loading…
Reference in a new issue