Update component view from a background Task

Hi everyone. In my application I have a background task registered with TaskManager and it’s called every n. milliseconds (with start location updates for example).
Now, how can I update a view of a component from this task? I’ve included Redux too in my project for other reasons and I could for example import and recreate the store in this task (it uses HeadlessJS as far as I know), the problem is that the store created in this situation is a different store than the one used by the app… and it would be a mess.

There is some sort of way to do this? I could clearly use a storage (asyncstorage for example), but then I’d need to do some sort of polling over those async storage values and I absolutely don’t want to do that!

Bumping this question… I have the same ask.

In case someone finds this thread, a couple of possibilities were posted here.

Apologies if I sound like a dick, but this part of the question is totally incorrect and it may confuse other developers:

“I’ve included Redux too in my project for other reasons and I could for example import and recreate the store in this task (it uses HeadlessJS as far as I know), the problem is that the store created in this situation is a different store than the one used by the app… and it would be a mess.”

When you create a redux store using the createStore function you can import it into any non-React file or section of your app and any updates you make by calling store.dispatch will update the same store as the one being used by your React components.

You never “recreate the store”, you create it once and then import it directly into a non-React file or gain access to it in a React component using the connect HOC and mapStateToProps.