App.js file, I have this code:
                  
                  
                  return (
                  
                  
                      <QuizContextProvider>
                  
                  
                        {
                  
                  
                        (createQuiz) ? (
                  
                  
                          <div></div>
                  
                  
                        ) : (
                  
                  
                          <div>
                  
                  
                          <Modal/>
                  
                  
                          <Question question={questions[questionNumber]} next={goToTheNext} />
                  
                  
                          </div>
                  
                  
                        )
                  
                  
                        }
                  
                  
                        {console.log(createQuiz)}
                  
                  
                      </QuizContextProvider>
                  
                  
                    );
                  
                  
                  }
                  
                  
                   It works fine but the console.log part outputs createQuiz value twice. Why not once but twice?
                  
                  
                
in development mode react runs all effects twice
Обсуждают сегодня