Skip to content

useDisplayModal

useDisplayModal<T>(args?): UseMutationResult<ModalRpcStepsResultType<T>, FrakRpcError<undefined>, DisplayModalParamsType<T> & { placement?: string; }, unknown>

Defined in: react/src/hook/useDisplayModal.ts:51

Hook that return a mutation helping to display a modal to the user

It’s a @tanstack/react-query!home | `tanstack` wrapper around the `displayModal()` action

T extends ModalStepTypes[] = ModalStepTypes[]

The modal steps types to display (the result will correspond to the steps types asked in params) An array of `ModalStepTypes` If not provided, it will default to a generic array of ModalStepTypes

Optional config object with mutations for customizing the underlying @tanstack/react-query!useMutation | `useMutation()`

MutationOptions<T>

Optional mutation options, see @tanstack/react-query!useMutation | `useMutation()` for more infos

UseMutationResult<ModalRpcStepsResultType<T>, FrakRpcError<undefined>, DisplayModalParamsType<T> & { placement?: string; }, unknown>

The mutation hook wrapping the displayModal() action The mutate and mutateAsync argument is of type `DisplayModalParamsType<T>`, with type params T being the modal steps types to display The data result is a `ModalRpcStepsResultType`

  • `displayModal()` for more info about the underlying action
  • @tanstack/react-query!useMutation | `useMutation()` for more info about the mutation options and response