在react-native中默认使用decorator会红屏报错,需要安装一个babel插件: 

babel-plugin-transform-decorators-legacy
在react-native中使用es7语法中的decorator装饰器

 

然后在根目录下的.babelrc中添加刚刚安装的插件:
在react-native中使用es7语法中的decorator装饰器

重新运行项目就可以了。

相关文章:

  • 2021-10-07
  • 2022-01-14
  • 2022-12-23
  • 2022-12-23
  • 2022-01-15
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-06-05
  • 2021-05-21
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案