Dan
Dan

Reputation: 1727

Babel for relay and react-native-drawer

I’m trying to use relay along with react-native-drawer but it gives me _this.state.viewport is undefined. I’ve narrowed down the problem to babel but not sure now to proceed. (edited)

I got there after reading this issue https://github.com/root-two/react-native-drawer/issues/140 (edited)

relay uses

{
  "passPerPreset": true,
  "presets": [
    {"plugins": ["./plugins/babelRelayPlugin"]},
    "react-native"
 ]
}

and I think that’s the problem (edited)

I tried using babel-plugin-transform-class-properties but doesn’t seem to help

Upvotes: 0

Views: 63

Answers (1)

Dan
Dan

Reputation: 1727

I found a solution and created a template. Summary is using react-native-router-flux and babel-relay-plugin-loader

https://github.com/hiaw/rn-relay-drawer-template

Upvotes: 1

Related Questions