-
So currently I'm using WatermelonDB with RxJS as per WatermelonDB's documentation to have observable database queries. These queries depend on my global state which I store in async storage and send that to each individual screen using react navigations params, however I was told that it would be better to store this using Context API similar to how firebase auth is setup. CodeContext Provider:
Component:
What I'm trying to do
but I get an invalid hook call so I'm wondering if there is a way to use RxJS to do so or if there is a different approach I can use pass this global state to all my screens without redux |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
I'd suggest asking this in WatermelonDB, as it's more a React + WatermelonDB question rather than rxjs. If
But again, it's sounds like it's something that WatermelonDB (or its community) should have already solved |
Beta Was this translation helpful? Give feedback.
-
Ended up using
Documentation: https://github.com/acdlite/recompose/blob/master/docs/API.md#fromrenderprops |
Beta Was this translation helpful? Give feedback.
Ended up using
fromRenderProps()
from recompose. Example code:Documentation: https://github.com/acdlite/recompose/blob/master/docs/API.md#fromrenderprops