Difference between React JS and React Native
Before coming to our main topic first, we have a basic command of the similarities between React JS & React Native.
So both are the framework of Java Script, and they are used for UI (User Interface) designing and sharing the same coding syntax. But before starting your coding journey you need to know the fundamentals of HTML, CSS, and of course Java script.
If we talk about the difference between them, so it is mostly used for website development and web-Application creation, while the other hand, React Native is used for building applications for cross-platform such as IOS and Andriod-based devices.
If you want depth info, read the down below article.
What is React JS and why it's famous?
As discussed that React JS is a JavaScript framework and Libray also, It is used to create the Web-Applications and UI design. For design & development, the coder must command HTML, CSS, and JavaScript.
React JS is famous for building one-page Web-Application. It means you don't need to create multiple web pages, you just need to create components and Import them in your Render folder.
I know it looks too tough while reading but when you explore the example and try it with yourself it will be pretty much easy.
Example Code:
Component.js:
Import react from 'React'
<div id="id01">Hello World!</div>
export default component;
App.js:
Import react from 'React'
Import Component from 'component'
<script type="text/babel">
ReactDOM.render(
document.getElementById('id01'));
</script>
Result:
Hello World!
What is React Native and why it's famous?
React Native is a framework of Javascript that is used to create Applications for cross-platforms such as IOS and Andriod. It has pretty much the same syntax as React JS and, Yes HTML, CSS, Javascript, and also OOP's(Object Oriented Programming) concepts are plus points while learning React Native.
If we talk about its major work of it, so it will use to build APIs and components which are technically the same as React JS.
Example Code:
import React, {Component} from 'react';
import {Platform, StyleSheet, Text, View} from 'react-native';
type Props = {};
export default class App extends Component<Props> {
render() {
return (
<View>
<Text>Hello World</Text>
</View>
);
}
}
Result:
Hello World!
Note:
This output will show in the interface of a cell phone program.
Conclusion:
In the above article, we learn about the difference between React JS & React Native, and we also talk about these topics and its example in depth.
Thank you for reading my article, hope our information will be beneficial for you.
Comments
Post a Comment