How can I create new react app using create-react-app` but without expo? - react-native

I need to initialize a new react native project. Recommended method to create a react native project is by using a tool called create-react-app.
But this tool comes with built in 'expo' tool-chain which omit creating ./android directory within my application root directory.
Is there a way to tell while create-react-app command to create the app without integrating "Expo" ?
Why I need this is that i want to use some external native Java libraries integrated with my react-native app.

If you want to use the new archictecure with Hermes (RN version 0.70 or later), you can run:
npx react-native#latest init AwesomeProject
Where the name of your project can replace AwesomeProject.
As they note, first make sure to remove react-native-cli if you have it installed globally.
npm uninstall -g react-native-cli #react-native-community/cli
Read more from the official docs here.

Related

Not able to create React native app using React native version 0.69.0

I have tried to install app using
npx react-native init ProjectName
But it has just created package and node module files and not created Platform-specific folders like android and ios.
Try rerunning this command in another folder.
Check if there any errors in terminal where you ran that command

Using React-Native Cli, how to use constants etc. other expo dependent things?

So due to some issues, we starteed project without expo but now every other tutorial shows expo, it uses constants or icons from expo, how to use them?
you can install follow these instructions: https://docs.expo.io/bare/hello-world/
alternatively, init your project with expo init and choose a "bare" template - this is the same as a project created with react-native CLI but with expo modules set up.

Generate Android and IOS folder in react native directory with Yarn

I have been having some trouble finding some straight answers in generating android and ios packages in a pre-existing react-native project.
yarn start works for me to view my project in on the web browser but I am trying to create an ios and android native project from this pre-existing website. Right now I have an empty template project that can be made using these commands on Mac Os after installing yarn:
yarn create react-app website
Now here is what my directory looks like. It is missing the android and ios directories that I will use and then run the command
yarn ios
or
yarn android
Thanks I really appreciate the help. I have never worked with react-native so if the answer is obvious please explain anyways.
yarn create react-app website
It will create website only, if you want to create react native app use
expo init AwesomeProject
or
npx create-react-app my-app
or
npx react-native init AwesomeProject
If you want to give support of web inside your react-native app, you can use react-native-web

is it necessary to rebuild react-native project after linking

I would like to know if it's necessary to rebuild react native project after installing and linking libraries that includes native codes.
Yes, as react-native-link updates some native files that are under the ios/android folder, that won't be checked during a reload/hot-reload/live-reload. All those files aren't checked in your jsBundle and are compiled during a run-android or run-ios.
Of course, if you added a new dependecy to the project and linked it, and you haven't used it anywhere in your code yet, you don't need it. If you are using that dependecy, your project instance will, most likely, die.
if your react native version is below 0.60 then you have to run react-native-link after you install any react-native module. However after react-native version 0.60 and above, this is done automatically using the new "autolinking" feature added.
Read the changelog here:
https://facebook.github.io/react-native/blog/2019/07/03/version-60
However you still need to rebuild your project after you install a native module but you dont need to run the react-native-link command anymore after installing every library after react-native#0.60 and above. Just type react-native run-android

How can I insert expo module in a React-native project?

I tried to use react-native-admob but It gives me a lot of problems. So I want to install with npm the expo module to use expoadmob that I'm sure works fine. I created a project with react native and tried to use "npm install expo --save" to add the expo module, but it didn't work. Anyone have a solution?
Not sure to understand.
You have 2 ways to create RN application expo-cli and react-native-cli.
You can't use expo for your module because you need to have a access to the native part (created with react-native-cli)
yarn add react-native-admob#next
AND don't forget to link the dependencies with
react-native link