This is a:
Which concerns:
What is the current behaviour?
require is not defined on app start up
What is the expected behaviour?
App starts correctly
Which package versions are you using?
react-native: 0.57.8
flow-runtime: 0.17.0
babel-plugin-flow-runtime: 0.19.0
.babelrc
{
"presets": [
"module:metro-react-native-babel-preset",
"@babel/preset-flow",
"@babel/preset-env",
"@babel/preset-react"
],
"plugins": [
[
"@babel/plugin-transform-flow-strip-types"
],
[
"@babel/plugin-proposal-decorators",
{
"legacy": true
}
],
[
"@babel/plugin-proposal-class-properties",
{
"loose": true
}
],
[
"flow-runtime",
{
"assert": true,
"annotate": true,
"optInOnly": true
}
],
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-syntax-import-meta",
"@babel/plugin-proposal-json-strings",
"@babel/plugin-proposal-function-sent",
"@babel/plugin-proposal-export-namespace-from",
"@babel/plugin-proposal-numeric-separator",
"@babel/plugin-proposal-throw-expressions"
]
}
I haven't found a correct configuration for react-native 0.57+ and babel 7 on Internet. This might be me doing something wrong. I tried my best to convert the configuration from here to use with react-native and babel 7 though.
This is a:
Which concerns:
What is the current behaviour?
require is not definedon app start upWhat is the expected behaviour?
App starts correctly
Which package versions are you using?
react-native: 0.57.8
flow-runtime: 0.17.0
babel-plugin-flow-runtime: 0.19.0
.babelrc{ "presets": [ "module:metro-react-native-babel-preset", "@babel/preset-flow", "@babel/preset-env", "@babel/preset-react" ], "plugins": [ [ "@babel/plugin-transform-flow-strip-types" ], [ "@babel/plugin-proposal-decorators", { "legacy": true } ], [ "@babel/plugin-proposal-class-properties", { "loose": true } ], [ "flow-runtime", { "assert": true, "annotate": true, "optInOnly": true } ], "@babel/plugin-syntax-dynamic-import", "@babel/plugin-syntax-import-meta", "@babel/plugin-proposal-json-strings", "@babel/plugin-proposal-function-sent", "@babel/plugin-proposal-export-namespace-from", "@babel/plugin-proposal-numeric-separator", "@babel/plugin-proposal-throw-expressions" ] }I haven't found a correct configuration for react-native 0.57+ and babel 7 on Internet. This might be me doing something wrong. I tried my best to convert the configuration from here to use with react-native and babel 7 though.