Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

React高版本(v16.1.1)出现 TypeError: Cannot read property 'string' of undefined #1

Open
1 of 2 tasks
uwyc opened this issue Nov 28, 2017 · 1 comment
Open
1 of 2 tasks

Comments

@uwyc
Copy link

uwyc commented Nov 28, 2017

这是一个

  • 错误报告
  • 功能需求
TypeError: Cannot read property 'string' of undefined
0
D:/Projects/dingtalk-demo-app/node_modules/salt-icon/lib/LoadingRound.js:109
  106 | 
  107 | // http://facebook.github.io/react/docs/reusable-components.html
  108 | IconLoadingRound.propTypes = {
> 109 |   className: _react2.default.PropTypes.string,
  110 |   name: _react2.default.PropTypes.string.isRequired,
  111 |   width: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.string, _react2.default.PropTypes.number]),
  112 |   height: _react2.default.PropTypes.oneOfType([_react2.default.PropTypes.string, _react2.default.PropTypes.number]),

Salt Icon 版本

3.4.0

浏览器、操作系统等环境信息

Windows 10
> node -v
v8.9.0
> npm -v
5.5.1
---
package.json
...
"dependencies": {
    "react": "^16.1.1",
    "react-dom": "^16.1.1",
    "react-scripts": "1.0.17",
    "salt-icon": "^3.4.0",
    "saltui": "^3.1.17"
}
...

问题原因

Note: React.PropTypes is deprecated as of React v15.5. Please use the prop-types library instead.

https://stackoverflow.com/a/44573437

暂定解决方案

降低React版本到v0.14.9

@eternalsky
Copy link
Contributor

目前组件的支持还在 0.14.x 上。15.x 的兼容我们最近会进行。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants