Heading for the future

Cannot read property 'createElement' of undefined

场景:

  架构:React+TS+DVA

    具体场景: 在将之前后缀为jsx的组件转化为tsx后缀的组件时,抛出Cannot read property 'createElement' of undefined

  

 解决方案:

  在tsconfig.json中添加配置

"esModuleInterop": true
"allowSyntheticDefaultImports": true

  作用:允许导入符合es6模块规范的CommonJS模块。

 

posted @ 2019-11-27 23:30  一只菜鸟攻城狮啊  阅读(8632)  评论(0编辑  收藏  举报