What is the best practice to share common code between Create-React-App (web) and Expo-App?

Disclaimer: I am a newbie in react-native. For my use case, i have a simple crud app using CRA and redux. Currently I have a single repo containing src for both of my backend and frontend.

I like to add an expo app. I also like to refactor out redux code into a share project as follow.

/MyProject
./backend
./web
./mobile
./share

What is the best practices to wire these project up? As you can see, i am trying to do a mono-repo. Do you use any tool? such as bitsrc.io ? Any recommend tutorial in this topic? Thanks

I don’t know if it’s a best practice, but I wrote an article on how to use the Render Props pattern to share code between mobile and web apps. You can find it here: Sharing Code Between React Web and React Native Applications | by Reginald Johnson | React Native Training | Medium

Thanks reggie3. I am specifically looking into the a minimalistic technique for monorepo and currently trying out yarn workspace. But thanks for the article.

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.