useWizardModal is a custom hook that provides a modal component for wizards. It accepts various parameters and returns an object with functions and properties related to the wizard modal.

  • Type Parameters

    • Data extends {} = Record<string, any>
    • Payload = any

    Parameters

    • params: IParams<Data, Payload>

      The parameters for the useWizardModal hook.

      • fallback

        The fallback function to be called when an error occurs during rendering.

      • pathname

        The pathname for the history object. Defaults to "/".

      • history

        The history object. If not provided, a new memory history object will be created.

      • fullScreen

        Determines whether the modal should be displayed in full screen. Defaults to true.

      • onLoadEnd

        The function to be called when the wizard finishes loading.

      • onLoadStart

        The function to be called when the wizard starts loading.

      • throwError

        Determines whether an error should be thrown when an error occurs during submission. Defaults to false.

      • onChange

        The function to be called when the wizard state changes.

      • onSubmit

        The function to be called when the wizard is submitted. Defaults to a function that returns true.

      • onMount

        The function to be called when the wizard component is mounted.

      • onUnmount

        The function to be called when the wizard component is unmounted.

      • onClose

        The function to be called when the modal is closed.

      • submitLabel

        The label for the submit button.

      • title

        The title of the wizard modal.

      • hidden

        Determines whether the modal should be hidden. Defaults to false.

      • outletProps

        Additional props to pass to the WizardOutletModal component.

    Returns {
        close: () => Promise<boolean>;
        open: (
            url?: string | URL,
            target?: string,
            features?: string,
        ) => null | Window;
        pickData: () => void;
        render: () => Element;
    }

    • An object with functions and properties related to the wizard modal.
    • Readonlyclose: () => Promise<boolean>
    • Readonlyopen: (url?: string | URL, target?: string, features?: string) => null | Window
    • ReadonlypickData: () => void
    • Readonlyrender: () => Element