SheetXL - v1.0.2
    Preparing search index...

    Function RenderSlot

    • Mounts a render slot as its own component, so a renderer may call hooks however (and wherever) the host renders it — inside a useMemo, a conditional, or a portal built in an effect.

      Type Parameters

      • P

      Parameters

      Returns ReactNode

      Its type never changes, so an inline arrow passed as render does not remount it. A renderer's hooks therefore persist across renderers: swapping between two renderers that call different hooks breaks the hook order, the same as a component that changes the hooks it calls. Give the slot a key per renderer if a host must swap them.

      Draw functions on a hot path (renderCell) are called directly, not through a slot, and must not call hooks.

      <RenderSlot render={renderCommentCard} props={{ sheet, coords, comment }} />