You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Element ref was specified as a string (map) but no owner was set #199
Hi, I'm getting an error when I attempt to load the Map component.
Uncaught Error: Element ref was specified as a string (map) but no owner was set. This could happen for one of the following reasons:
You may be adding a ref to a functional component
You may be adding a ref to a component that was not created inside a component's render method
You have multiple copies of React loaded
See https://fb.me/react-refs-must-have-owner for more information.
at invariant (VM56119 invariant.js:42)
at coerceRef (VM56126 react-dom.development.js:7350)
at createChild (VM56126 react-dom.development.js:7555)
at reconcileChildrenArray (VM56126 react-dom.development.js:7805)
at reconcileChildFibers (VM56126 react-dom.development.js:8121)
at reconcileChildrenAtExpirationTime (VM56126 react-dom.development.js:8240)
at reconcileChildren (VM56126 react-dom.development.js:8231)
at updateHostComponent (VM56126 react-dom.development.js:8539)
at beginWork (VM56126 react-dom.development.js:8986)
at performUnitOfWork (VM56126 react-dom.development.js:11814)
Below is my dependency list. I attempted to degrade react to ^15.0.0, but other packages broke.
@fergatron@vongdarakia This package is not compatible with React 16+. I downgraded my React to 15.x.x according to this article and I got past that error. Of course, this may break other package compatibilities depending on your project.
In case you are a beginner like me, after making this change to React versions, you need to wipe out node_modules and package-lock.json, then run npm install again.
I have react ^16.5.2 and I received this error because I didn't install npm install --save google-maps-react in the client folder. And I have just installed the package inside of the client folder and GoogleMaps is showing up now.
Activity
vongdarakia commentedon Jun 13, 2018
I have this same problem, and I'm unsure what's going on :/
8ozStudios commentedon Jul 2, 2018
I'm having the same issue, @fergatron @vongdarakia have you resolved it yet?
8ozStudios commentedon Jul 2, 2018
@fergatron @vongdarakia This package is not compatible with React 16+. I downgraded my React to 15.x.x according to this article and I got past that error. Of course, this may break other package compatibilities depending on your project.
In case you are a beginner like me, after making this change to React versions, you need to wipe out node_modules and package-lock.json, then run npm install again.
AtlasMaxima-zz commentedon Oct 17, 2018
I have react ^16.5.2 and I received this error because I didn't install
npm install --save google-maps-reactin the client folder. And I have just installed the package inside of the client folder and GoogleMaps is showing up now.codeglider commentedon Jan 1, 2019
@atlasmaxima what does it mean to install in a "client" folder?
Hi-Rube commentedon Feb 7, 2019
use like this:
nkov commentedon Apr 5, 2019
This works for me in development but not in production, minified mode.
nkov commentedon Apr 5, 2019
I issued a PR to solve this issue by using callback refs instead of string refs. Feel free to use my branch until it's merged here:
"google-maps-react": "nkov/google-maps-react#ref-bug",