Inject
Renders components next to the children, before or after them.
Usage
Use Inject for elements a layout always keeps alongside its children, like a background or custom cursor. It renders them as siblings, so the children aren't wrapped.
tsx
<Inject components={[Background, Cursor]} onTop>
<Page />
</Inject>Background
Cursor
Page
Reference
| prop | type | default | |
|---|---|---|---|
components? | Renderable[] | [] | rendered as siblings of the children |
onTop? | boolean | false | render them before the children instead of after |
children? | ReactNode | — | the children, rendered as they are |