Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

compatibility react-native-web ? #71

Open
flyjennyetn opened this issue Dec 22, 2016 · 5 comments
Open

compatibility react-native-web ? #71

flyjennyetn opened this issue Dec 22, 2016 · 5 comments

Comments

@flyjennyetn
Copy link

compatibility react-native-web ?

@chandlervdw
Copy link

Yes. We're still working through lots of issues, but they don't necessarily pertain to react-native-web's ability to render web components. We are using two different routers, one for native (router/index.js) and one for web (router/index.web.js).

@flyjennyetn
Copy link
Author

@chandlervdw There are examples?

@nicholeuf
Copy link

@flyjennyetn We are following the example from react-native-web here using webpack aliases. The shared code imports from react-router-native and react-native. We have two router files for generating the routes for each platform since native uses different constructs (nativeHistory, TabsRoute, and StackRoute). Other than that, Link, withRouter, Routes etc are identical, for the most part, thanks to the goal of API parity with react-router.

Our webpack config looks something like this:

resolve: {
    alias: {
      'react-native': 'react-native-web',
      'react-router-native': 'react-router'
    },
  },

@flyjennyetn
Copy link
Author

@nicholeuf thanks a lot

@VinceBT
Copy link

VinceBT commented Dec 29, 2016

@nicholeuf Could you give us an exemple of routes for ReactRouter and ReactRouterNative ? I have some problems with all the TabsRoute, StackRoute and IndexRoutes that are not allowed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants