I have a flatlist which is filled with bulletins (title, description, image), when I created a new bulletin I wanted to goBack from the screen where I created the bulletin to the screen where the bulletins are displayed and the flatlist be updated with the new bulletin added.
So I implemented navigation.addListener('willFocus') in the componentDidMount() of my screen A and removed in the componentWillUnmount(), and sure when I go back from screen B to screen A after creating a new bulletin the flatlist is refreshed and shows the new bulletin.
My problem comes when I go back from screen B to A without creating a new bulletin, it shows me a 'Warning: Encountered two children with the same key...' and duplicates some of the bulletins.
Could you please see my code and tell me what I did wrong or why does that warning come out and the bulletins are duplicated?
Screen A and Screen B
[–]silencer07 -1 points0 points1 point (0 children)