app. Here follows the description:
This is from App.js file:
App.js
As can be seen it is a conditional rendering: a Modal window asks a user whether they want to take the existing quiz or create their own and when the user clicks "Create your own " button, the app should re-render over again, this time the button sets the value of createQuiz to true. In order to handle this I have used the useEffect hook in my <Modal /> component a follows:
<Modal />
But when I click the 'Create your own' in my Chrome browser nothing happens. Could someone clarify what I am doing wrong here?
I forgot to include this code from my <Modal /> component: const {createQuiz, setCreateQuiz} = useContext(QuizContext)
Обсуждают сегодня