Top 5 React Interview Questions and Prep
2 min readJun 17, 2024
Question 1: What are the major features of React?
- React uses JSX syntax. JSX is a syntax extension of Javascript that allows developers to write HTML in their JS code. JSX stands for Javascript XML.
- React uses the Virtual DOM instead of Real DOM. Real DOM manipulations are expensive.
- React supports server-side rendering.
- React follows unidirectional or one-way data flow or data binding.
- React uses reusable/composable UI components to develop the view.
Question 2: What is JSX?
JSX stands for Javscript XML. It provides the syntactic sugar for the
React.createElement(type, props, ...children)
It is a syntax extension of JSX. An example, of a variable declaration in JSX is like so.
const element = <h1>Hello, world!</h1>;
Question 3: What is the difference between Element and Component?
A component is a set of elements.
- An element does not have states or props. They are simply something visual.
- A component is a function which returns JSX element or element…