React is a javascript library for building user interfaces developed by facebook
React can be used to develop
1. Websites
React is largely used by big tech companies to develop their websites some of them being Microsoft, meta, Netflix, Airbnb
2. Mobile app Development
Developers can also develop mobile apps with react using its Framework named ReactNative where you use react concepts to develop mobile apps for android and ios.
3. Desktop apps
Developers can also develop desktop apps using another javascript framework named electron that helps developers create cross-platform apps. some of the apps created using electron are vscode, Microsoft teams, Twitch
some of the reasons to use React
1. great ecosystem
React provides a flexible ecosystem for developers to choose which libraries to use apart from react for their development which provides greater customizability for features and structure.
2. Declarative
Declarative in programming terms means you only tell what to do and how to do is taken care by react . Here is some code from react docs
class HelloMessage extends React.Component {
render() {
return <div>Hello {this.props.name}</div>;
}
}
root.render(<HelloMessage name="Harshit" />); // Hello Harshit
Also, the declarative way is much easier to maintain and debug
3. Component-Based
React is a component based that makes it easier to change state and also this small small components helps in making complex UI
4. Virtual-DOM
React keep track of the changes and compare it with the real dom and only updated the UI elements that have been updated making it Faster in rendering and performance
I hope you liked the blog