When to use
When you need display components based on a single condition.
Usage
When not to use
If you need to conditionally render components that have multiple outcomes, use the Switch/Match family. If you want to display a loading Skeleton, use the Suspense tag or loading route file (NextJS) instead.
API
Props
The Show
component accepts the following props:
Name | Default | Description |
---|---|---|
when | false | The condition to evalue for showing the children or fallback. |
fallback | null | The content to render when the condition is false. |