expo / ex-navigation

Route-centric navigation for React Native
997 stars 201 forks source link

Support for the experimental syntax 'exportNamespaceFrom' isn't currently enabled #511

Open zakster12 opened 6 years ago

zakster12 commented 6 years ago

I have this issue when trying to use the ex-navigation.

My package.json:

{
"dependencies": {
    "@expo/ex-navigation": "^4.2.0",
    "react": "16.4.1",
    "react-native": "0.56.0",
    "react-native-maps": "^0.13.0"
  },
  "devDependencies": {
    "@babel/plugin-proposal-decorators": "^7.0.0",
    "@babel/plugin-syntax-dynamic-import": "^7.0.0",
    "babel-jest": "23.4.2",
    "babel-preset-react-native": "^5",
    "eslint-config-rallycoding": "^3.2.0",
    "jest": "23.5.0",
    "react-test-renderer": "16.4.1"
  },
  "jest": {
    "preset": "react-native"
  }
}

My .babelrc is: { "presets": [ "react-native" ], "env": { "development": { "plugins": [ "@babel/plugin-syntax-dynamic-import" ] } } }

I tried with

{
  "presets": ["react-native-stage-0/decorator-support"]
}

but have other issues which some mentioned that they fixed with the first part of the code which I shared. Any suggestions?

screen shot 2018-09-05 at 13 31 25

milesegan commented 6 years ago

Installing this plugin fixed this for me:

https://babeljs.io/docs/en/next/babel-plugin-syntax-export-namespace-from.html

elie222 commented 5 years ago

Doesn't seem to have worked for me:

{
  "presets": ["babel-preset-expo"],
  "plugins": ["@babel/plugin-syntax-export-namespace-from"],
  "env": {
    "development": {
      "plugins": []
    },
    "production": {
      "plugins": ["transform-remove-console"]
    }
  }
}

Any suggestions? Tried with the plugin in env.development too, but no luck.

elie222 commented 5 years ago

Updating the package from:

export * as NavigationStyles from './ExNavigationStyles';

to:

import * as NavigationStyles from './ExNavigationStyles';
export { NavigationStyles };

Seems to have worked.