how can i change the isLoading state to false i'm trying this and i get the error setIsLoading is read only
const[isLoading, setIsLoading] = React.useState(true);
const[userToken, setUserToken] = React.useState(null);
useEffect(() => {
setTimeout(() => {
setIsLoading=(false);
}, 1000);
}, []);
CodePudding user response:
you have a typo in setIsLoading=(false);
change to setIsLoading(false)