Using Redux Provider: id mismatch?
See original GitHub issueSteps to reproduce
Render any react component with a Provider on the server (set prerender as true)
Expected behavior
The component should be generated from the server, then UJS should mount the client version
Actual behavior
System configuration
Sprockets or Webpacker version: No version (Latest) React-Rails version: No Version (Latest) Rect_UJS version: React-Rails specified. Rails version: 5.1.4 Ruby version:2.5.0
I’m attempting to pre-render a component with a Provider, but it has issues when UJS tries to automatically mount the client version on top of it.
- My setup absolutely works outside of redux. Rendering any normal component works.
react-on-rails
is not only too far of a departure, but it’s too battery included, no migration instructions, and I’d like to depend on this more official release.
Issue Analytics
- State:
- Created 6 years ago
- Reactions:2
- Comments:14 (8 by maintainers)
Top Results From Across the Web
Error: Invalid hook call at Provider,while using react-redux
This could happen for one of the following reasons: 1. You might have mismatching versions of React and the renderer (such as React...
Read more >Provider | React Redux
Provider. Overview. The <Provider> component makes the Redux store available to any nested components that need to access the Redux store.
Read more >Handling user authentication with Redux Toolkit
To make these store values accessible to every component, wrap the entire application with the React Redux Provider component:
Read more >Redux - YouTube
Redux Toolkit Tutorial · Redux For Beginners | React Redux Tutorial · React Redux ( with Hooks) Crash Course · Redux Toolkit ·...
Read more >Match - React Router: Declarative Routing for React.js
A <Route> that uses the children prop will call its children function even when the route's path does not match the current location....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
+1. Although Redux has nothing to do with this gem, many users of this gem seems to be struggling to use Redux with this gem.
FYI. My usage example of Redux with this gem is below:
repo: https://github.com/ttanimichi/react_rails_with_redux_example
❤️ @ttanimichi thank you for that example! Yes I’ve noticed there are a fair few people who use
react-rails
as the entry point for transitioning fromrails
toreact
, so there are a lot of cases where it’s absolutely nothing to do withreact-rails
and everything to do with Webpack or React themselves but I do still try to help when and where they can.There is probably a real issue where
react-rails
doesn’t define exactly how little it does for people so it’s not possible for them to tell when it’s an issue using the gem or an issue using something deeper. I’ve added examples and Wiki pages where possible to help out for those that do read them, not sure how much further to go as beyond a certain point they’re better reading the source materials for tools mentioned.