1.Warning: Accessing PropTypes via the main React package is deprecated. Use the prop-types package from npm instead.
2.Warning: RouterContext: React.createClass is deprecated and will be removed in version 16. Use plain JavaScript classes instead. If you're not yet ready to migrate, create-react-class is available on npm as a drop-in replacement.
“import { Button } from 'antd';”這個語法導致的1和2的問題是嗎
你這個只是warning,并不影響開發的,其實你不用管的。
至于出現warning的原因,里面已經說的很清楚了:
PropTypes已經不建議直接從react中獲取了,而是從prop-types組件中獲取
createClass也會在react 16中去除,所以不建議使用。
可能是因為你引入的某些組件還在使用這些東西吧,不過只是warning并不影響開發的。