的兼容性
我只是在文件的顶部导入:
import DayPicker from 'react-day-picker'
,然后我在控制台中遇到了这个错误,似乎无法弄清楚。
Weekdays.js?f84d:23 Uncaught TypeError: Super expression must either be null or a function, not undefined
at _inherits (Weekdays.js?f84d:23)
at eval (Weekdays.js?f84d:26)
at eval (Weekdays.js?f84d:77)
at Object../node_modules/react-day-picker/lib/src/Weekdays.js (person.js:4066)
at __webpack_require__ (common.js:694)
at fn (common.js:115)
at eval (Month.js?f52a:17)
at Object../node_modules/react-day-picker/lib/src/Month.js (person.js:4014)
at __webpack_require__ (common.js:694)
at fn (common.js:115)
我在react v0.14.8上,我遇到了同样的错误。在反应日捕获器的v6.0.0中,将某些组件转换为使用React.purecomponent(在React V15.3.0中引入)。我相信这就是为什么我们会遇到错误的原因,因为我们的React版本没有React.purecomponent。修复程序将是将您的反应升级为v15.3.0 。
如果您使用的是react-day-picker v6.0,请尝试升级到v6.2,其中列置换量已被shouldComponentUpdate
替换。这应该保持与React 0.14