react-d3 / react-d3-map

react-d3 interactive map
111 stars 30 forks source link

× TypeError: Cannot read property 'func' of undefined #30

Open luli-isa opened 7 years ago

luli-isa commented 7 years ago

I try integrate react-d3-map on my react project. I installed package using npm

npm install --save react-d3-map

And import on my React component

var Map = require('react-d3-map').Map;
var PolygonGroup = require('react-d3-map').PolygonGroup;

When I try to use Map components, I have the following error: × TypeError: Cannot read property 'func' of undefined (anonymous function) node_modules/react-d3-map/lib/map.js:139

, {
    key: 'childContextTypes',
    value: {
      geoPath: _react2['default'].PropTypes.func.isRequired,
      projection: _react2['default'].PropTypes.func.isRequired
    },
    enumerable: true
chrisjbrown commented 6 years ago

+1 same

seems to be missing in docs

aldofunes commented 6 years ago

Apparently it has to do with the React version react-d3 is using. A solution may be to use prop-types npm module instead

jimnoss commented 6 years ago

Use the latest 3.x version of react-router (3.2.0). This is working. npm i react-router@3.2.0