React Interview Questions Part1
React Interview Questions Part1
12. What is the difference between HTML and React event handling?
Answer: In React, event names are camelCase (e.g., onClick instead of onclick), and you
pass a function reference rather than a string. React also uses a SyntheticEvent
Answer: SyntheticEvent is a wrapper around the browser’s native event. It ensures that
Answer: They allow you to conditionally render elements directly within JSX using
15. What is the 'key' prop and what is its benefit when used in arrays of elements?
Answer: The 'key' prop helps React identify which items have changed, are added, or
are removed. It improves rendering performance and helps avoid rendering bugs.
Answer: The Virtual DOM is a lightweight JavaScript object that represents the real
Answer: React creates a virtual copy of the real DOM. When the state changes, React
compares the new Virtual DOM with the old one (diffing), calculates the most efficient
18. What is the difference between Shadow DOM and Virtual DOM?
Answer: Shadow DOM is a browser technology used for encapsulating styles and
markup in web components. Virtual DOM is a concept used by React for efficient
rendering.
Answer: React Fiber is the new reconciliation engine in React 16+. It enables features