Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface TransitionReturnValue<E>

Type parameters

  • E: HTMLElement

Hierarchy

Index

Properties

appearing

appearing: boolean

Boolean if the transition is in the initial mounting/appearing stage while entering. This will be false if the appear option is false and automatically set to false after the first transition if appear was true.

dispatch

dispatch: Dispatch<TransitionAction>

A dispatch function that cna update the transition state manually. This should really not be used too much unless your transition is for appear only transitions. For those cases, you can watch for a value change and just trigger the ENTER transition again:

const prevThing = useRef(thing);
if (thing !== prevThing.current) {
  prevThing.current = thing;
  dispatch(ENTER);
}

Note: This should be dispatched during the render to get the correct timing.

ref

ref: (instance: null | E) => void

Type declaration

    • (instance: null | E): void
    • A ref that must be passed to a DOM node for the transition to work. This technically should not need to be passed to a DOM node for non-css transitions or transitions that do not require access to a DOM node, but it it seems like too much work to make it conditional for those types for transitions.

      Parameters

      • instance: null | E

      Returns void

rendered

rendered: boolean

Boolean if the component should be rendered in the DOM. This will always be true if the temporary option is omitted or false. Otherwise, it will be true during the transitions and entered.

stage

The current stage for the transition. This probably won't be used too much unless you want to apply custom classnames based on the stage.

Generated using TypeDoc