I am trying to figure out how to set up the contexts to handle background updates and also be able to handle form input. Here's what I did but I know it's wrong because I have the issue where the form gets rerendered and the data disappears
<BackendDataContextProvider><Stack.Navigator><Stack.Screen name="list" component="ListDataFromBackendComponent"><Stack.Screen name="update" component="UpdateEntryComponent"></Stack.Navigator></BackendDataContextProvider>
The BackendDataContextProvider
has a state called dataFromBackend
which is set every 60 seconds.
UpdateEntryComponent
does not rely on the dataFromBackend
info but because of the heirarchy it is still rerenders.
I am thinking I have to change BackendDataContextProvider
to split it into a background fetcher and another component that is used in the ListDataFromBackendComponent
However, is there a less "drastic" approach that I may be missing?