salt-icon's People
salt-icon's Issues
React高版本(v16.1.1)出现 TypeError: Cannot read property 'string' of undefined
这是一个
- 错误报告
- 功能需求
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
低版本安卓模拟器报错 Symbol is not defined
安卓模拟器:网易mumu
内核版本:4.4.4
开发环境:钉钉开发版 4.2
https://github.com/salt-ui/salt-icon/blob/master/src/Icon.jsx#L51
低版本安卓模拟器中无Symbol类型,for of语法由babel转编译后会使用Symbol.iterator,此处报错后无法继续执行
建议使用for in语法代替
`
try {
for (var _iterator = Object.keys(_iconMap2.default)Symbol.iterator, _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
var icon = _step.value;
Icon[icon] = _iconMap2.default[icon];
}
} catch (err) {
_didIteratorError = true;
_iteratorError = err;
} finally {
try {
if (!_iteratorNormalCompletion && _iterator.return) {
_iterator.return();
}
} finally {
if (_didIteratorError) {
throw _iteratorError;
}
}
}
`
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.