Write your first Component in the React Native for iOS and Android.

Sahil Pandya
1 min readAug 21, 2021

--

You will need Node, Watchman, the React Native command line interface, Xcode and CocoaPods

How to install Node and Watchman

brew install node
brew install watchman
sudo gem install cocoapods
Note: Watchman is a tool by Facebook for watching changes in the filesystem.
It is highly recommended you install it for better performance.

Creating a new application using below command

npx react-native init ProjectName

Follow below steps to start the project with your first component

Once setup is done, It will generate all the files related iOS and android.1. Go to Root folder and find index.ios.js and index.android.js file.2. Check which component is used for rendering the component.3. It will render App.js file component.4. Open App.js file.5. Import App.js file in the index.ios.js and index.android.js file.6. Then Run your app using command line.7. Start Application in the iOS simulator using below command.
npx react-native run-ios
8. Start Application in the Android emulator using below command.
npx react-native run-android

--

--

Sahil Pandya
Sahil Pandya

Written by Sahil Pandya

Learning, Exploring, Implementing and then Writing things after experience.

No responses yet