I'm tring to update a state and just after, to do other things with this state like this :
const [isStudent, setIsStudent] = useState<null | boolean>(null);
const onPressItem = (titre: string) => {
[Do things...]
setIsStudent(true);
navigation.navigate('OtherScreen, {isStudent: isStudent});
}
The probleme is, in my OtherScreen, the variable isStudent
egal null, like if setIsStudent(true)
don't work right now.
Any solutions ?