Assuming that you have installed the React Native as per instruction given in the post - Installing React Native in Ubuntu Linux / Mac OS
This will create a new AwesomeProject Folder and copy all necessary files and folders. This will install all the dependencies for your project.
<Text>Hello world!</Text>
You whole index file should look like this
import React, { Component } from 'react';
import { AppRegistry, Text } from 'react-native';
export default class HelloWorldApp extends Component {
render() {
return (
<Text>Hello world!</Text>
);
}
}
// skip this line if using Create React Native App
AppRegistry.registerComponent('AwesomeProject', () => HelloWorldApp);
$cd AwesomeProject
$react-native run-android #for android
$react-native run-ios #for iOS
It should start compiling and bundled in a package. If your android emulator is already running, the new application should start automatically inside your emulator and print the Hello World Text.
Step 1: Open the Terminal
Press CTRL+T to open the terminal in Linux or Find Terminal by searching it in MacStep 2: Create a new react native project
$react-native init AwesomeProjectThis will create a new AwesomeProject Folder and copy all necessary files and folders. This will install all the dependencies for your project.
Step 3: Type Hello World String
Go inside the AwesomeProject folder you will see index.android.js and index.ios.js. If you are developing for Android edit index.android.js or if you are developing for IOS edit index.ios.js. Now open any of them type hello world by replacing the default text in the following way.<Text>Hello world!</Text>
You whole index file should look like this
import React, { Component } from 'react';
import { AppRegistry, Text } from 'react-native';
export default class HelloWorldApp extends Component {
render() {
return (
<Text>Hello world!</Text>
);
}
}
// skip this line if using Create React Native App
AppRegistry.registerComponent('AwesomeProject', () => HelloWorldApp);
Step 4: Run the Awesome Project
Assuming your already inside the AwesomeProject if not go inside the AwesomeProject$cd AwesomeProject
$react-native run-android #for android
$react-native run-ios #for iOS
It should start compiling and bundled in a package. If your android emulator is already running, the new application should start automatically inside your emulator and print the Hello World Text.
Such an informative blog that i have ever red.I have read it very interesting information's.
ReplyDeleteiOS Training in Chennai
iOS Training in Tambaram
JAVA Training in Chennai
Python Training in Chennai
Hadoop Training in Chennai
SEO Training in Chennai
IOS Training in Chennai
iOS Training in OMR
Great Article
DeleteAndroid Final Year Project Ideas for Computer Science
FInal Year Project Centers in Chennai
JavaScript Training in Chennai
Java Training in Chennai
The way of describing Technology is well. I'm really happy to read this blog. Keep sharing more like this.
ReplyDeleteMobile Testing Training in Chennai
mobile testing course in chennai
Mobile Testing Training in Porur
Manual Testing Training in Chennai
Manual Testing course in Chennai
Drupal Training in Chennai
Photoshop Classes in Chennai
Mobile Testing Training in Chennai
I have been searching for this information and got to know now. Thanks to the admin for sharing this blog.
ReplyDeleteEnglish Speaking Classes in Mumbai
English Speaking Course in Mumbai
Best English Speaking Classes in Mumbai
Spoken English Classes in Chennai
Best Spoken English Classes in Chennai
Spoken English Class in Chennai
Great info. The content you wrote is very interesting to read. This will loved by all age groups.
ReplyDeleteReactJS Training in Chennai
ReactJS Training
ReactJS course
ccna Training in Chennai
gst classes in chennai
ux ui design course in chennai
Salesforce Training in Chennai
Angularjs Training in Chennai
Wonderful Blog!!! Thanks for sharing this post with us... and it is more helpful for us.
ReplyDeleteIOS Training in Chennai
iOS Course in Chennai
Best ios Training institutes in Chennai
IOS Training in Velachery
IOS training in Adyar
Python Training in Chennai
Software testing training in chennai
JAVA Training in Chennai
I Appreciate this it was a nice article Salesforce Training Institute In Hyderabad. it was a helpful article for all.
ReplyDelete