React JS is a JavaScript library used to build user interfaces (UI) for websites and web applications.
It was developed by Facebook (now Meta).
Example:
websites and apps that use React include Facebook and Instagram.
Why do we use React JS?
- To build interactive websites.
- To create reusable UI components.
- To update webpage content efficiently.
- To manage user interactions, like button clicks.
React JS Example:
function App() {
return (
Hello Sathish!
Welcome to React JS.
);
}
export default App;
Output:
Hello Sathish!
Welcome to React JS.
Here:
- function App() — creates a React component.
- return — specifies the UI to display.
— displays a heading.
- export default App — allows the component to be imported into another file.
Top comments (0)