Npx react-native init app2 -template react-native-template-typescript Npx react-native init app1 -template react-native-template-typescript If your app names and directories match you can use this instead: cd packages Npx react-native init SecondApp -directory app2 -template react-native-template-typescript ![]() Npx react-native init FirstApp -directory app1 -template react-native-template-typescript To create React Native projects we can use the following commands: cd packages Workspaces: our workspace with the projects structured in a tree.That's very important because we don't want to make our workspaces public. open and check your package.json file.create a package.json file with yarn init -y,.open your terminal and go to the root directory cd my-app,. ![]() Creating a package.json file in the root directory Shared/ <- folder for shared components, logic, etc. Here’s an example of how our project structure can look like: my -app/ Our projects need to be divided into subfolders. When creating a monorepo for react native applications, it is better to avoid using nohoist because we don't need duplicates inside the root level and inside the project level node_modules. ![]() This can unlock a variety of benefits like core sharing, simplified ci/cd process and consistent tooling. Monorepos enable sharing of components, functions and logic between all of the included applications. To start we should ask a simple question: why should I use a monorepo for React Native apps? It's actually very useful when you have two (or more) similar applications.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |