How to describe React.js…
Developed by Facebook.
Renders user interfaces.
There are two main ways data gets handle in React: state and props.
Props or properties are used to pass values or data from a parent component to its children. Like HTML properties, we can inject props to give values dynamically. A props value should not be change during its component’s lifecycle.
- Initial — when component is created
- getDefaultProps and getInitialState — methods are only called once when initially rendering component. The initial state value is set and props are defined.
- componentWillMount — happens before render.
- render — returns component markup
- componentDidMount — DOM can be accessed in this method
React is a good framework for single page applications because it is fast. By using a virtual DOM, it can handle updates and render different views efficiently. React’s modularity can also help organize the complexities and views in a SPA.