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

addComponentAsRefTo() error because google_map.js loads a second copy of React #4

Open
jedwards1211 opened this issue Jul 22, 2015 · 0 comments

Comments

@jedwards1211
Copy link

I'm getting this error:
Uncaught Error: Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. This usually means that you're trying to add a ref to a component that doesn't have an owner (that is, was not created inside of another component'srendermethod). Try rendering this component inside of a new top-level component which will hold the ref.

Somehow the GoogleMap component was loading a second copy of React. I think it's similar to what these people are seeing:
facebook/react#3320

I had to use the PrefetchPlugin on react to get google-map-react to work. Maybe the rest of my code was loading plain old 'react' and GoogleMap is loading 'react/addons', but in any case I think it would help other developers new to google-map-react to have a note about this.

@jedwards1211 jedwards1211 changed the title addComponentAsRefTo() error due to complexity of peer dependencies? addComponentAsRefTo() error because google_map.js loads a second copy of React Jul 22, 2015
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

1 participant