React Portals Quiz
11 Questions
2 Views

Choose a study mode

Play Quiz
Study Flashcards
Spaced Repetition
Chat to lesson

Podcast

Play an AI-generated podcast conversation about this lesson

Questions and Answers

Portals provide a first-class way to render children into a DOM node that exists outside the DOM hierarchy of the parent component. The first argument (child) is any renderable React child, such as an element, string, or fragment. The second argument (container) is a DOM element. Usage Normally, when you return an element from a component’s render method, it’s mounted into the DOM as a child of the nearest parent node

portals

However, sometimes it’s useful to insert a child into a different location in the DOM

portals

A typical use case for portals is when a parent component has an overflow: hidden or z-index style, but you need the child to visually “break out” of its container. For example, dialogs, hovercards, and tooltips. Try it on CodePen Event Bubbling Through

Portals

Go to ______ for the new React docs. These new documentation pages teach modern React and include live examples: createPortal

<p>react.dev</p> Signup and view all the answers

These docs are old and won’t be updated.

<p>react.dev</p> Signup and view all the answers

Practical data fetching with React ______ that you can use today has been published on dev.to.

<p>Suspense</p> Signup and view all the answers

The hottest topic these days in the React community, and everybody gets either super excited or completely confused when the word '______' is thrown around.

<p>Suspense</p> Signup and view all the answers

In this article, I’m not going to cover all the details of what the heck is up with this ______ thing, as this has been discussed and explained numerous times, and the official docs are very explicit about the topic.

<p>Suspense</p> Signup and view all the answers

Instead, I will show you how you can start using it today in your ______ projects.

<p>React</p> Signup and view all the answers

But I thought it’s experimental and we shouldn’t use it yet” ______ mode is experimental.

<p>Concurrent</p> Signup and view all the answers

Suspense for lazy-loaded components, and even simple data fetching, works today.

<p>React.Suspense</p> Signup and view all the answers

More Like This

Use Quizgecko on...
Browser
Browser