Chevalier Antoine• 670
@SeyBoo
Posted
Hello ! Bravo for your first react solution ! For best practice you could :
- Create a file for every component that you created so it's easier to read
- The App file is not a component so i shouldn't be in the components folder
- Instead of using
style={{display:show ? "":"none"}}
you should look for conditional rendering (I was doing the same mistake ahah)
https://reactjs.org/docs/conditional-rendering.html
const [showModal, setShowModal] = useState(false);
{showModal ? <Modal /> : null }
<button onClick={() => setShowModal(!showModal)}>Display modal</button>
Have a nice day :)
Marked as helpful
0
Icekid35• 260
@Icekid35
Posted
@SeyBoo thanks for the tips I'll surely improve on them
1