Skip to content
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

Inject ReactDefaultBatchingStrategy #58

Closed
wants to merge 1 commit into from
Closed

Inject ReactDefaultBatchingStrategy #58

wants to merge 1 commit into from

Conversation

bjyoungblood
Copy link

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.

@maberer
Copy link

maberer commented May 21, 2014

I have the exact same issue.... and just submitted an issue as well.... (before I saw yours)...
please see #59.

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

@bjyoungblood
Copy link
Author

I'm using browserify, but my setup separates the vendor bundle (including react) from our application bundle. I think our issues may be related.

@maberer
Copy link

maberer commented May 22, 2014

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.

@andreypopp
Copy link
Collaborator

There's standalone react-router-component build released on bower.

Andrey Popp

On 22 ìàÿ 2014 ã., at 10:09, tindli notifications@github.com wrote:

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.


Reply to this email directly or view it on GitHub.

@maberer
Copy link

maberer commented May 22, 2014

@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.

@larrymyers
Copy link

@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.

@bjyoungblood
Copy link
Author

Ok, then this is probably not a real bug. Going to close this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants