useDisplayModal
Ce contenu n’est pas encore disponible dans votre langue.
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
Type Parameters
Section titled “Type Parameters”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
Parameters
Section titled “Parameters”Optional config object with mutations for customizing the underlying @tanstack/react-query!useMutation | `useMutation()`
mutations?
Section titled “mutations?”MutationOptions<T>
Optional mutation options, see @tanstack/react-query!useMutation | `useMutation()` for more infos
Returns
Section titled “Returns”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