react-here-maps icon indicating copy to clipboard operation
react-here-maps copied to clipboard

Get the React.PropTypes.Object error when using "react": "^16.4.2",

Open rsand111 opened this issue 7 years ago • 4 comments

Trying to add react-here-maps library to a react app version 16.4.2, but getting the : TypeError: Cannot read property 'object' of undefined 55 | } 56 | // define the context types that are passed down from a <HEREMap> instance 57 | Circle.contextTypes = {

58 | map: React.PropTypes.object 59 | }; 60 | Circle.defaultProps = { 61 | fillColor: "rgba(255, 255, 255, 0.5)",

I do believe that this is due to the 'prop-types' being moved to it's own library. What are the chance of recompiling it with a more recent version of react ? I try building the library myself, but the build failed with an error stating that it was looking for a apple enviroment. Do you know of another more modern library ???

Regards RS

rsand111 avatar Sep 11 '18 15:09 rsand111

Same issue here.

Anshr avatar Sep 13 '18 11:09 Anshr

Also receiving the same issue

seanconrad1 avatar Sep 20 '18 22:09 seanconrad1

i have a same issue.

quocthangit247 avatar Oct 05 '18 14:10 quocthangit247

  1. npm install --save prop-types

  2. node_modules\react-here-maps\dist\Circle.js

    • adding var PropTypes = require('prop-types');
    • changing line 58 Circle.contextTypes = { map: PropTypes.object };
  3. node_modules\react-here-maps\dist\Marker.js

    • adding var PropTypes = require('prop-types');
    • changing line 71 Marker.contextTypes = { map: PropTypes.object };
  4. node_modules\react-here-maps\dist\HEREMap.js

    • adding var PropTypes = require('prop-types');
    • changing line 91 HEREMap.childContextTypes = { map: PropTypes.object };

MonaAliIbrahim avatar Jan 16 '20 10:01 MonaAliIbrahim