What are the key features of React.js?
What is unidirectional data flow in react?
What is JSX?
-A syntax extension for JavaScript that allows you to write HTML-like code within your JavaScript files.
Explain the concept of virtual DOM in React.js.
A lightweight copy of the real DOM which allows React to efficiently update and render only the necessary components when there are changes
What is a functional component
JavaScript functions that receive props as input and return JSX elements as output.
What are class components
Now are considered a little bit out dated compared to functional components. They extend the React.Component class and have the lifecycle methods.
What is the purpose of state in React?
How do you update state in React?
What are controlled components in React?
What is the significance of keys in React lists?
Used to help React uniquely identify and differentiate between elements in an array of components.
What is React Router?
What is the purpose of the useEffect hook in React?
What is the purpose of the useContext hook?
What is the purpose of the useCallback hook?
What is the purpose of the useRef hook?
Allows you to create a mutable reference that persists across renders and doesn’t cause a re-render when it’s value changes.
It is commonly used to access or store DOM elements without triggering a re-render.
What is the significance of the Fragment component in React?
How can you optimize performance in React applications?
Explain the concept of React Hooks.
Functions that make it possible to use state and handle side effects in Functional Components in place of Class Components.
What is Redux?
A state management library for JavaScript applications. .
What are React Portals?
How can you handle errors in React?
This is something that is easier to do with Class Components because functional components cannot capture errors during rendering.
You create something called an ErrorBoundary class that wraps a component and then use the getDerivedStateFromError and componentDidCatch lifecycle methods to essentially catch any errors that occure with that components hierarchy.
This limits the impact of those errors so that the whole application doesn’t fail.
What are Higher-Order Components (HOCs) in React?
They take a component as a prop input, they wrap that component in reusable functionality and return it as a now enhanced component.
How can you handle events in React?
attaching event handlers such as onClick, to JSX elements.
How do “keys” help React to more efficiently render lists of components?
When the state or props change, react will compare the new list of keys to the old list and determine the differences so as to minimize unnecessary re-renders.