ink-cartridge
    Preparing search index...

    Function applyElementToModalLayer

    • Apply an element to a registered modal layer.

      props is type-checked against the element component's own prop type — the same type-safety pattern skip() uses for params.

      When the target modal layer has not been opened, the action is ignored (with a development warning) and the previous state is kept.

      Type Parameters

      • C extends ComponentType<any>

      Parameters

      Returns void

      // after openModalLayer('confirm-dialog', 100)
      applyElementToModalLayer('confirm-dialog', {
      elementId: 'confirm-dialog-element',
      element: ConfirmDialog,
      props: { onCancel: () => closeModalLayer('confirm-dialog') },
      });