我还没有找到如何将流运行时集成到我的本地反应项目(RN 0.57.8)中。
这是我的.babelrc
{
"presets": [
"module:metro-react-native-babel-preset",
"@babel/preset-flow"
],
"plugins": [
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
[
"@babel/plugin-proposal-class-properties",
{
"loose": true
}
],
[
"flow-runtime",
{
"assert": true,
"annotate": true,
"optInOnly": true
}
]
]
}
打包版本:
react-native: 0.57.8
flow-runtime: 0.17.0
babel-plugin-flow-runtime: 0.19.0
在应用启动时,我得到Unexpected token {
。在添加流运行时之前,应用程序已正确启动。