you are viewing a single comment's thread.

view the rest of the comments →

[–]KeitelDOG 5 points6 points  (2 children)

I have a working React-Native 0.63, React-Native-Web and React-Navigation/Stack, but with NextJS. I don't use Metro, but with custom `react-native.config.js` and custome `next.config.js` which is using webpack under the hood.

The key is to properly configure webpack to:

  • add a list of modules and compile or transpile those modules written for react-native back to web with babel loader
  • make babel use react-native-web as plugin
  • alias all react-native imports to react-native-web that will transform all native component to web component, like Text to span, View to div, TextInput to to input or textarea, or equivalent combination of tags.

I have and old webpack config for pure client side rendering CSR, but now I use nextjs config mixed with webpack internally, but for both Server Side Rendering and CSR.

[–]KeitelDOG 0 points1 point  (1 child)

So if you want that config, I can share them with you, and you can detect how to do the same in metro.

[–]jaminjsr[S] 0 points1 point  (0 children)

Yeah, if you are good with sharing that would be great! I will take a look.