ydeshayes / googlePlaceAutocomplete

Wrapper on top of the material-ui AutoComplete component that use google place api
https://ydeshayes.github.io/googlePlaceAutocomplete/
26 stars 12 forks source link

Cannot read property 'getLayer' of undefined #2

Closed acomito closed 7 years ago

acomito commented 8 years ago

modules.js:159259 Uncaught TypeError: Cannot read property 'getLayer' of undefined

<GooglePlaceAutocomplete
  onNewRequest={(selectedData, searchedText, selectedDataIndex) => console.log(selectedData)}
  name={'location'}
  floatingLabelText='location'
  style={styles.fieldStyle}
/>

Also getting the following two:

modules.js:159235 Warning: It looks like you're using a minified copy of the development build of React. When deploying React apps to production, make sure to use the production build which skips development warnings and is faster. See https://fb.me/react-minification for more details.

and

Uncaught Invariant Violation: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component'srendermethod, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).

ydeshayes commented 8 years ago

The react problem is because material-ui have ReactJS as production dependency, so there is two react in the scope, I will search if I can remove material-ui from the final dist file because it is required to have it in your app anyway.

I will look at this tomorrow :) thanks for the report !

ydeshayes commented 8 years ago

https://github.com/ydeshayes/googlePlaceAutocomplete/commit/b67db29e21772141c5932e32d1792c8e6b51a99a

Can you test if this commit fix your errors ?

Thanks !

ydeshayes commented 7 years ago

@acomito up ?

ydeshayes commented 7 years ago

@acomito