Quantcast
Channel: Active questions tagged react-native+typescript - Stack Overflow
Viewing all articles
Browse latest Browse all 6288

How to handle background updates and form input in React?

$
0
0

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?


Viewing all articles
Browse latest Browse all 6288

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>