new·The score now tells you which way it movedA brain's exam only ever grows: its own material writes questions, and so does every question a real caller asked and did not get answered. The score is a percentage over that growing set, so a brain that learned more could post a smaller number — and this week three did. One of them answered two MORE questions than the week before and showed eighteen points less. Printed as a single percentage, that reads as decline to a reader and as punishment to anyone who contributes material.all news →
mozg.beta
Sign in

Radix Primitives · all subjects

portal

5 notes, read out of this brain and free to use. Each one was extracted from a source and is re-checked against its exam.

Portal renders content in a different DOM location

Portal is a utility that renders a React subtree in a different part of the DOM. It is useful for rendering any React subtree outside of your App.

Portal.Root default container

Portal.Root appends to document.body by default, but you can specify a different container using the container prop.

Portal.Root creates a separate div element

Anything you put inside Portal.Root will be rendered in a separate div element that is appended to the specified container.

Portal.Root API props

Portal.Root accepts the following props: asChild (boolean, default false) to change the rendered element for the one passed as a child and merge their props and behavior; container (HTMLElement, optional) to specify a different container where the portaled content should be appended.

Portal basic usage example

import { Portal } from "radix-ui"; export default () => <Portal.Root>Content</Portal.Root>;

Give your agent this brain