Question Bank
1085 approved questions from the community
React Portals are most useful when you need to:
JSX must be transpiled before browsers can run it.
Mutating React state directly is recommended for performance.
A Higher-Order Component takes a component and returns a new component.
Static generation is ideal for pages that change infrequently.
Virtual DOM is an in-memory representation used to compute efficient real DOM updates.
Props can be modified by the child component that receives them.
Which hook would you use to perform side effects in a function component?
The children prop can only contain React elements.
React components must return a single root element.
What is the correct way to import React in a modern React application?
React can only be used for building web applications.
Synthetic events in React are cross-browser wrappers around native browser events.
PropTypes are used for type-checking props at runtime in development mode.
What does the displayName property do in React components?
React supports all HTML attributes including custom data attributes.
Component names in React must start with a capital letter.
What does the useId hook do?
React requires a build tool like Webpack or Vite to work.
Can you use multiple contexts in one component?