Share
Explain the purpose of render() in React?
Question
- 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.
- This function must be kept pure i.e., it must return the same result each time it is invoked.
Leave an answer