react-amap
react-amap copied to clipboard
引入react-amap-plugin-heatmap后报错
- [x] 我已经搜索过 issue,没有类似的问题,或者类似的问题仍然没有解决方案。
- [x] 我已经搜索过文档,并且仍然没有找到解决方案。
- [x] 我写了个问题重现的例子,链接或者代码将会贴在下面。
Reproduce Example Link or Code Fragment
引入react-amap-plugin-heatmap插件后报错, Cannot read property 'preventAmap' of undefined 报错代码: return Children.map(this.props.children, function(child) { if (child) { var cType = child.type; /* 针对下面两种组件不注入地图相关属性 * 1. 明确声明不需要注入的 * 2. DOM 元素 */ console.log('cType======', cType); if (cType.preventAmap || typeof cType === 'string') { return child; } return _react2.default.cloneElement(child, { map: _this2.map }); } return child; }); }
What is Expected?
热力图可以正常加载,不报错
What is actually happening?
js报错,地图加载不出来
同样遇到这个问题 但是我是自定义组件时发生的 是升级后才出现的