Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface NiceModalHandler<Props>

The handler to manage a modal returned by useModal hook.

Type parameters

  • Props = Record<string, unknown>

Hierarchy

Index

Properties

Optional args

args: Record<string, unknown>

Optional delayVisible

delayVisible: boolean

id

id: string

keepMounted

keepMounted: boolean

If you don't want to remove the modal from the tree after hide when using helpers, set it to true.

visible

visible: boolean

Whether a modal is visible, it's controlled by show/hide method.

Methods

hide

  • hide(): Promise<unknown>

reject

  • reject(args?: unknown): void
  • Reject the promise returned by show method.

    Parameters

    • Optional args: unknown

    Returns void

remove

  • remove(): void
  • Remove the modal component from React component tree. It improves performance compared to just making a modal invisible.

    Returns void

resolve

  • resolve(args?: unknown): void
  • Resolve the promise returned by show method.

    Parameters

    • Optional args: unknown

    Returns void

resolveHide

  • resolveHide(args?: unknown): void
  • Resolve the promise returned by hide method.

    Parameters

    • Optional args: unknown

    Returns void

show

  • show(args?: Props): Promise<unknown>
  • Show the modal, it will change visible state to true.

    Parameters

    • Optional args: Props

      an object passed to modal component as props.

    Returns Promise<unknown>

Generated using TypeDoc