Skip to content

useSwitchTransition

Select mode:

API

useSwitchTransition

function useSwitchTransition<S>(state: S, options?: SwitchTransitionOptions): ({
  transition: (renderCallback: SwitchRenderCallback<S>) => JSX.Element[]
  isResolved: boolean
})
 

SwitchTransitionOptions

interface SwitchTransitionOptions {
  timeout?: number | { enter: number, exit: number }
  mode: 'default' | 'in-out' | 'out-in'
}

SwitchRenderCallback

export type SwitchRenderCallback<S> = (
  state: S,
  statusState: StatusState & { prevState?: S, nextState?: S }
) => React.ReactNode
 

StatusState

See useTransition#StatusState