Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
8 views

React Interview Questions

Uploaded by

shreyas_135
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
0% found this document useful (0 votes)
8 views

React Interview Questions

Uploaded by

shreyas_135
Copyright
© © All Rights Reserved
Available Formats
Download as PDF or read online on Scribd
You are on page 1/ 7
FOLLOW TO LEARN MORE React Interview Questions with answers eQv => What is the significance of React.Fragments? © React Fragments allow you to group multiple elements without adding unnecessary nodes to the DOM. e It’s useful when you don’t want to introduce an additional parent div. => What are React Hooks? React Hooks are functions that let you use state and other React features in functional components instead of class components m= Explain useEffect Hook useEffect is a Hook that performs side effects in your function components. It runs after every render and can be used for data fetching, subscriptions, manually changing the DOM, etc => What is the significance of keys in React lists * Keys are used to give React a way to identify which items have changed, are added, or are removed in alist. © They help in optimizing the rendering process => What is the Context API in React The Context API provides a way to pass data through the component tree without having to pass props down manually at every level m™> How does React handle prop drilling, and what’s the solution? © Prop drilling occurs when you pass props through multiple levels of components. © The solution is to use Context API or Redux for managing state globally. A ez => What is the significance of PureComponent in React ¢ PureComponent is a base class for class components that implements a shouldComponentUpdate method with a shallow prop and state comparison. e Ithelps in preventing unnecessary renders for performance optimization => Explain React Router © React Router is a standard library for routing in React applications. ¢ It enables the navigation among views in the application, allowing the user to interact with the UI without a full page reload => What is the significance of the memo function in React The memo function in React is used to memoize functional components, preventing unnecessary re- renders if the props haven’t changed => Explain the concept of higher-order components (HOCs) in React ¢ Higher-order components are functions that take a component and return a new component with extended or modified functionality. ¢ They are used for code reuse, logic abstraction, and component composition. => What are React Hooks rules? Hooks in React must be called at the top level (not inside loops or conditions), and they must be called from React functional components or custom Hooks => Explain the concept of server-side rendering (SSR) in React. ¢ Server-side rendering in React involves rendering the initial HTML on the server rather than the browser. ¢ This can improve the page load performance and provide better SEO => What is the purpose of the React.StrictMode component « React.StrictMode is a component in React used for highlighting potential problems in the application during the development mode. ¢ It helps catch common mistakes and future proofs the code => Explain the concept of controlled components in React © Controlled components in React are components where the value of form elements like input fields is controlled by the state. ¢ This allows React to handle and validate the form data

You might also like