Open abhaychitnis opened 7 years ago
Have you tried <WaterMapView/>
instead of just WaterMapView
?
Yes. This was pointed out by someone else as well. I have corrected it. However the error remains same. I am modifying my post accordingly
Hi, having the same issue in my project. I tried some debug and found out that the error happens just by including the map component:
import {Map, GoogleApiWrapper} from 'google-maps-react';
But I can't find the solution..
Hello, I'm experiencing the same issue with a simple test case.
Error:
TypeError: Cannot read property 'array' of undefined
(anonymous function)
X:/Users/John/Documents/code/WanderSpark/wander-spark/client/node_modules/google-maps-react/dist/components/Polygon.js:190
187 | }(_react2.default.Component);
188 |
189 | Polygon.propTypes = {
> 190 | paths: _react.PropTypes.array,
191 | strokeColor: _react.PropTypes.string,
192 | strokeOpacity: _react.PropTypes.number,
193 | strokeWeight: _react.PropTypes.number,
| (anonymous) | @ | Polygon.js:190
-- | -- | -- | --
| ./node_modules/google-maps-react/dist/components/Polygon.js.Object.defineProperty.value | @ | Polygon.js:3
| ./node_modules/google-maps-react/dist/components/Polygon.js | @ | Polygon.js:13
| __webpack_require__ | @ | bootstrap c764c94…:669
| fn | @ | bootstrap c764c94…:87
| ./node_modules/google-maps-react/dist/index.js.Object.defineProperty.value | @ | index.js:3
| ./node_modules/google-maps-react/dist/index.js | @ | index.js:13
| __webpack_require__ | @ | bootstrap c764c94…:669
| fn | @ | bootstrap c764c94…:87
| ./src/containers/GoogleApiTest.js | @ | App.js:23
| __webpack_require__ | @ | bootstrap c764c94…:669
| fn | @ | bootstrap c764c94…:87
| ./src/App.js | @ | App.css?9a66:26
| __webpack_require__ | @ | bootstrap c764c94…:669
| fn | @ | bootstrap c764c94…:87
| ./src/index.js | @ | index.css?f255:26
| __webpack_require__ | @ | bootstrap c764c94…:669
| fn | @ | bootstrap c764c94…:87
| 0 | @ | registerServiceWorker.js:108
| __webpack_require__ | @ | bootstrap c764c94…:669
| (anonymous) | @ | bootstrap c764c94…:715
| (anonymous) | @ | bundle.js:719
Test component - GoogleApiTest.js:
import React, { Component } from 'react';
import { GoogleApiWrapper } from 'google-maps-react';
class GoogleApiTest extends Component {
render() { return <div>Hi Google</div>; }
}
export default GoogleApiTest;
Pretty sure this is related to proptypes being deprecated in React 16: https://github.com/facebook/prop-types
I am using react-native-slideshow but I get this error: Cannot read property 'arrayOf' of undefined.
I did as some answer suggested: // install prop-types module // then import it in the codebase import React, { Component } from 'react'; import PropTypes from 'prop-types'; import Slideshow from 'react-native-slideshow';
export default class App extends Component {
render() { return ( <Slideshow dataSource={[ { url:'http://placeimg.com/640/480/any' }, { url:'http://placeimg.com/640/480/any' }, { url:'http://placeimg.com/640/480/any' } ]}/> ); } }
But I am still getting the same error: Help me please
I am new to ReactJS, but familiar with React Native. I am trying to to get a basic map component to be displayed.
My map component is
WaterMapView.js
This component is embedded in MainDashboard.js as follows :
My App.js component is :
And index.js is :
I am using React version 16.0.0 and google-maps-react version 1.1.0
I get an error accompanied by a dump of code. The error is :
TypeError: Cannot read property 'array' of undefined
I am not including the dump in this post. I can add that if required.
The problem seems very basic as the I do not even see the console.log statement 'I am here' in WaterMapView.js component.
Let me know what am I missing.