What is React?
React is a JavaScript library for creating user interfaces that are declarative, fast, and customizable. It's the letter 'V' in MVC.
ReactJS is an open-source, component-based front-end library that is only responsible for the application's display layer and React developed by Facebook.
One of React's fundamental building pieces is the component. In other words, we can say that every application you will develop in React will be made up of pieces called components. Components make the task of building UIs much easier. You can see a UI broken down into multiple individual pieces called components and work on them independently and merge them all in a parent component which will be your final UI.
There are two methods for creating components in React:
- Functional components
- Class components
const Demo=()=> { return <h1>Hello World!</h1>; }
class Demo extends React.Component { render(){ return <h1>Hello World!</h1>; } }
- It is difficult to reuse stateful logic between class components.
- In the class component, complex components are difficult to grasp.
- Class confuses both humans and machines.
No comments:
Post a Comment