I have a table that has items in it. When I click a specific item's edit button. It goes to edit page but when I submit an edit of that item. It goes back to main table page but the table page won't be updated. So, I think I need to trigger the useeffect function. To do that I need to update the state in main table page from another screen that is edit page screen.
my apps are not class-based. all of them functional. Here are my codes.
Main Table Page:
  //I created a state to update
  const [reload,
    setReloader] = useState(''); 
   I try to send the state to change it in edit item screen. 
  <TouchableOpacity onPress={() => navigation.navigate('addProduct', [reload])}> 
Edit Item Page:
  const [reload,
    setReloader] = useState(route.params.reload); //I tried to pass state but it didn't work like that. 
 
     
    