Skip to content

Configuration for React Native #229

@terreb

Description

@terreb

This is a:

  • Bug Report
  • Feature Request
  • Question
  • Other

Which concerns:

  • flow-runtime
  • babel-plugin-flow-runtime
  • flow-runtime-validators
  • flow-runtime-mobx
  • flow-config-parser
  • The documentation website

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions