16 Conceptual React Questions to Stand Out in Your Next Interview
Can you handle these ReactJS questions? Let’s find out!

Answering a conceptual question in an interview doesn’t mean you will be better than others on the job, but it surely means you have the time and interest to understand the deep concepts in a framework.
One’s understanding of documentation separates a good developer from a great developer.
Well, today, we will look into some of these conceptual questions that you may want to know as a React developer. If you are looking for simple syntax-related questions, then this article is not for you!
Let’s get started!
1. What is Render Hijacking in React?
As Mr. Google says, Render Hijacking is
“The concept of render hijacking is the ability to control what a component will output from another component”.
Practically you wrap your component with another Higher-Order-Component (HOC). And then, you inject props according to your need that can cause a change in the rendering logic.
Basically, what you are doing is enabling the component to behave differently.
2. What will happen if you use setState() in the constructor?
When you use setState() React re-renders the whole component once again. So if you call setState() inside a constructor, React tries to re-render the component that does not exist, creating a recursive problem.
You would get errors like this:
Can only update a mounted or mounting component.So we need to use this.state to initialize variables inside the constructor. Like the following
constructor(props) {
this.state = {
// anything that you want inside state
}
}3. What are synthetic events in React?
Events are any browsers essentially parts. Like onclick , onscroll Etc. But as React works with a virtual dom, we need to have a wrapper that works consistently across different browsers.
React normalizes events so that they have consistent properties across different browsers. — React Documentation
So, in summary, synthetic events are a cross-browser wrapper for different events. Important to note: they are not mapped one-to-one with browsers native events.
4. What are portals in React?
If you want to render some child component into a DOM node outside the component tree hierarchy, then React Portal is the way to go.
The syntax for this is
ReactDOM.createPortal(child, container)The first argument is any render-able React child, such as an element, string, or fragment. The second argument is a DOM element.
5. What is reconciliation?
When a component’s props or state change, We need to re-render the component. Whether the actual DOM will be updated or not depends on the difference between these two nodes (previous and current).
But to compare 2 nodes, we will need an O(n³) complexity which is not practical in real-life scenarios. That’s why React team has decided to use a heuristic approach.
And the name of this process is called reconciliation. If you are interested, refer to the documentation.
6. Why does React uses className over the class?
class Is a keyword in JavaScript, and JSX is an extension of JavaScript. That’s the principal reason why React uses className instead of class.





