React Portals Quiz
Test your knowledge of React portals, createPortal, modal rendering, event bubbling, context behavior, and portal accessibility concerns.
20 questions · free · answers explained
All questions in this quiz
- What does createPortal let you do in React?
- Which package exports createPortal?
- What are portals commonly used for?
- What arguments does createPortal primarily need?
- Does a portal change where the component lives in the React tree?
- How do React events from a portal bubble?
- Can portal content access React context from its parent tree?
- What must be true about the DOM node passed to createPortal?
- What happens if a different portal target DOM node is passed during an update?
- Why are portals useful for modals inside containers with overflow hidden?
- What should modal portals handle for accessibility?
- What should happen to portal content when the component that renders it unmounts?
- Why might a click handler on a React parent fire when clicking inside a portal?
- How can you stop a portal click from triggering a parent React click handler?
- What is the optional third argument to createPortal used for?
- Should createPortal be used to create the root of an entire React app?
- What is a common portal target for application overlays?
- What does a portal change about CSS stacking and DOM placement?
- Can a portal render a string or fragment as children?
- What should you consider before using a portal?
Prefer to read first? React interview questions with written answers.