I don't know why my map is not re-rendering, even if the state is updated.
const [newFaq, setNewFaq] = React.useState(questionReponse)
const addQuestion = () => {
newFaq.push({id: newFaq.length+1, question: "", reponse: ""})
setNewFaq(newFaq)
console.log(newFaq)
}
return (
<div className="main">
<div className="block">
{
newFaq.map((el, index) => {
return (<QuestionModif key={el.id} id={index} question={el.question} reponse={el.reponse} onGetValues={handleSubmit}/>)
}
)
}
</div>
</div>
);
};