You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey! I'm loving navi so far but I'm trying to get the static rendering stuff working with redux.
I'm getting this issue:
Could not find "store" in the context of "Connect(Component)". Either wrap the root component in a <Provider>, or pass a custom React context provider to <Provider> and the corresponding React context consumer to Connect(Component) in connect options.
Okay so I've just reread the docs and now I see that the main() function is only called in "real browsers". Wrapping each route in a <Provider> allows to build to complete.
Yeah, you should be able to get this to work by adding Redux's Provider to the exports of your register() call, then wrapping your app with it in a custom static renderer.
It's a little convoluted at the moment, although if we can get SSR Support merged into create-react-app, the situation should vastly improve.
If you managed to get it to work, can I close this issue off?
Nice work with the SSR PR. Good luck with it :) I'll close the ticket as it is working for now, but if you ever know of a cleaner way to do it, commenting on this thread would be greatly appreciate 👍
Hey! I'm loving navi so far but I'm trying to get the static rendering stuff working with redux.
I'm getting this issue:
I have this sorta thing in my
index.tsx
:I've narrowed my issue down to the fact that the components in
./routes.tsx
are not being wrapped up in the<Provider>
:To clarify, this works in dev, but when running
build
, I get the above error. Any direction would be great!Cheers
The text was updated successfully, but these errors were encountered: