I need to change the state and use it but isn't possible and i don't now whhy !!!!
const [valid, setValid] = useState(false)
let emailsApplied = []
candidatures.map(c => {
emailsApplied.push(c.email)
})
let emailSession = ''
if(session){
emailSession = session.email
}
if(emailsApplied.includes(emailSession)) {
setValid(true)
}