Share code with React Native

A few days ago, I needed to restructure a react web app in such a way, that we can build a react native app (with create-react-native-app) using as much of the existing code as possible. So the main goal was code reuse/code sharing, while not breaking react native’s reloading or introducing a complicated setup. Restructure the files Let’s start with the initial structure. The web app web contained all code, which was structured reducers, actions, api, components and so on:...

January 23, 2018 · 2 min · Dustin Chabrowski