Overview:
The React & React Native Monorepo is a boilerplate that provides a convenient setup for developing React and React Native applications. It comes with preconfigured tools and configurations for both web and native platforms. The monorepo structure allows for code sharing between the two platforms, making development more efficient.
Features:
- Create React App: Uses an integrated toolchain for the best user and developer experience on the web.
- @reach/router: A small and simple router for web applications.
- react-app-rewired: Allows for tweaking the Create React App webpack config without using ’eject'.
- react-native: Allows for creating native apps for Android and iOS using React.
- react-native-splash-screen: Provides a splash screen API for react-native that can programmatically hide and show the splash screen on both iOS and Android.
- @react-navigation/native: A navigation framework for react-native.
- @react-navigation/stack: Stack-navigation for @react-navigation/native.
- redux: A predictable state container for JavaScript apps.
- react-redux: Official React bindings for Redux.
- redux-thunk: Async action middleware for Redux.
- eslint and prettier: Help find and fix problems in JavaScript code.
- husky and lint-staged: Beautify code (staged) before every commit.
- Absolute imports for react and react-native: Easy and convenient import statements for React and React Native code.
Installation:
To install the React & React Native Monorepo, follow these steps:
- Run
yarn installto install the dependencies. - If you are planning to develop for iOS, make sure you have Xcode and Cocoapods installed. Run
yarn podsto install the iOS dependencies. - To delete all the
node_modulesand pods, runyarn clean. This will prepare the app for a fresh install. - Use
yarn startto start the Create React App’s development server and the React Native bundler. - Alternatively, you can use
yarn nativeto manually start the metro server for React Native, oryarn webto manually start the Create React App’s development server (note: the server is already started if you ranyarn start). - Use
yarn androidto run the app on an Android emulator or device. - Use
yarn iosto run the app on an iOS simulator. - You can also use
yarn studioto open the Android project in Android Studio, oryarn xcodeto open the iOS project in Xcode.
Summary:
The React & React Native Monorepo provides a convenient and preconfigured setup for developing React and React Native applications. It allows for code sharing between the two platforms, reducing development time and effort. The monorepo comes with all the necessary tools and configurations for both web and native platforms, making it easier for developers to get started with their projects.