-
Notifications
You must be signed in to change notification settings - Fork 83
Inject ReactDefaultBatchingStrategy #58
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
I have the exact same issue.... and just submitted an issue as well.... (before I saw yours)... Do you use a module bundler? I get the issue when using react from CDN and a bundle (containing react-router-component).... I think the problem arises due to accessing the libs of reactjs within react-router-component |
I'm using browserify, but my setup separates the vendor bundle (including react) from our application bundle. I think our issues may be related. |
ok. so you end up having two bundles you load separately as script tags I guess. If so, you can look into your application bundle to see if e.g.the invariant functionality is included here too... (and others resulting in duplication from the vendor bundle with react) The relevant line that causes the violation is in your application bundle and I guess thats the problem among other overwritten stuff that should only be handled by react. |
There's standalone react-router-component build released on bower. Andrey Popp
|
@bjyoungblood Any progress here? If I understand @andreypopp correctly, using the react-router-standalone from bower would work if you add react-router-component as an additional script tag on your site. But then you have 3 script tags alongside your application and vendor bundles... I guess you would like to include the router in your bundle... instead. For my part (#59) requiring this version from the bower_components directory does not work because the reference to "window" breaks when using server-side rendering. |
@bjyoungblood I can confirm that my issue with this went away when I included 'react-router-component' as part of my vendor bundle in browserify (the same bundle that react was in). Having a vendor bundle with react, and an app bundle with the router component leads to this issue. |
Ok, then this is probably not a real bug. Going to close this PR. |
I'm not sure why this is the case, but any time I navigated (either using a link or popState) using the router, I would get the following error:
Invariant Violation: ReactUpdates: must inject a batching strategy
This seems to fix it, though I'm not sure why it was a problem in the first case. Not sure if this is a good fix or if there is something else wrong with my setup, as we're using react with addons.