What is React JS?
What are the features of React?
Major features of React are listed below:
- It uses the virtual DOM instead of the real DOM.
- It uses server-side rendering.
- It follows uni-directional data flow or data binding.
Advantages of ReactJS:
- It increases the application’s performance
- It can be easily used on the client as well as server side
- Because of JSX, code’s readability increases
- React is easy to integrate with other frameworks like Angular, etc
- Using React, writing UI test cases become easy
Limitations of ReactJS:
- React is just a library, not a full-blown framework
- Its library is very large and takes time to understand
- It can be little difficult for the novice programmers to understand
- Coding gets complex as it uses inline templating and JSX
What are Components in ReactJS? Explain the Component Lifecycle.
- getDefaultProps and getInitialState, both methods are called only once while initially rendering of the component.
- componentWillMount : This method is executed just before rendering on both client and server side.
- ComponentWillReceiveProps: This method is invoked as soon as the props are updated before another render is called.
- ShouldComponentUpdate: This method should return true or false value. This determines whether if a component will be updated or not. Default it is set to true.
- ComponentWillUpdate: This method is called just before rendering.
- ComponentDidUpdate: This method is called just after rendering.
- ComponentWillUnmount: This method is called after the component is unmounted from the DOM.
Stateless and Stateful components
Stateless: When a component is “stateless”, it calculates state is calculated internally but it directly never mutates it. With the same inputs, it will always produce the same output. It means it has no knowledge of the past, current or future state changes
Stateful : When a component is “stateful”, it is a central point that stores every information in memory about the app/component’s state, do has the ability to change it. It has knowledge of past, current and potential future state changes.
Stateful component change the state, using this.setState method.
What is current stable version of React JS?
Release on: April 7, 2017
What is JSX?
<h1> Title from techcontents.com !!</h1>
What are the life Cycle of ReactJS??
- State/Property Updates
we will come with some more interview questions and answers on React JS