Answer the question
In order to leave comments, you need to log in
What is the correct way to use setstate in a functional component to change a boolean value?
Good afternoon everyone! I'm making a React project. when executing a function (authorization function) I need to change the boolean value in this code.
const [loggedIn, setLoggedIn] = React.useState(false);
setLoggedIn(true);
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question