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

Loading react-pixi creates conflict with react? #31

Closed
mikkmartin opened this issue Nov 17, 2015 · 6 comments
Closed

Loading react-pixi creates conflict with react? #31

mikkmartin opened this issue Nov 17, 2015 · 6 comments
Assignees

Comments

@mikkmartin
Copy link

Not sure if bug or doing something wrong, but when i use react-layout with latest react and try to render stage component via:

ReactLayout.render(ExampleStage)

i get an error (only when react-pixi loaded)

Uncaught TypeError: Cannot read property 'firstChild' of undefined

this works fine:

React.render(<ExampleStage />, document.body);

Also get a warning in console beforehand for both cases:

Warning: patching react to work with react-pixi

does the patching break compatibility with other versions?

@Izzimach Izzimach self-assigned this Nov 17, 2015
@Izzimach
Copy link
Owner

The Warning: patching react to work with react-pixi is normal, so no big deal.

Glancing over react-layout I don't see anything obviously odd going on. Do you know where in the code this error happens?

@mikkmartin
Copy link
Author

Uncaught TypeError: Cannot read property 'firstChild' of undefined appears on react-pixi.js line 12608

findComponentRoot function

firstChildren[0] = deepestAncestor.firstChild;

@mikkmartin
Copy link
Author

apparently react-pixi cant find root element from react layout, which is #react-root. Or react layout doesn't supply that properly

either way if i hard code

firstChildren[0] = document.getElementById('react-root');

it works properly

@Izzimach
Copy link
Owner

Yeah, it looks like react-layout manually creates the root DOM object react-root itself. That may be part of the cause. Similar to what's causing kadirahq/meteor-react-layout#36 maybe?

Do you have the react-root div in the HTML or are you relying on react-layout to insert it? Is there a barebones meteor/react app I can look it? I don't use meteor so it would take a while for me to whip up an app to reproduce the bug.

@mikkmartin
Copy link
Author

It appears it was a user error, there is a repo with meteor flow-roter using react pixi here, if anyone else runs into trouble.

@Izzimach
Copy link
Owner

Izzimach commented Dec 1, 2015

Thanks for the update!

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

No branches or pull requests

2 participants