11.Why can’t browsers read JSX?
Browsers can only read JavaScript objects but JSX in not a regular JavaScript object. Thus to enable a browser to read JSX, first, we need to transform JSX file into a JavaScript object using JSX transformers like Babel and then pass it to the browser.
12.Is it possible to use async/await in plain react?
If you want to use async/await in react, you will need babel and transform-async-to-generator plugin. React native ships with babel and a set of transforms.
13. Explain the lifecycle methods of react components in detail.
Some of the most important lifecycle methods are:
Componentwillmount() – executed just before rendering takes place both on the client as well as server-side.
Componentdidmount() – executed on the client side only after the first render.
Componentwillreceiveprops() – invoked as soon as the props are received from the parent class and before another render is called.
Shouldcomponentupdate() – returns true or false value based on certain conditions. If you want your component to update, return true else return false. By default, it returns false.
Componentwillupdate() – called just before rendering takes place in the dom.
Componentdidupdate() – called immediately after rendering takes place.
Componentwillunmount() – called after the component is unmounted from the dom. It is used to clear up the memory spaces.
14.What is the purpose of render() in React.
Each React component must have a render() mandatorily. It returns a single React element which is the representation of the native DOM component. If more than one HTML element needs to be rendered, then they must be grouped together inside one enclosing tag such as