Lilact
    Preparing search index...

    Function SwitchTransition

    • Switches between keyed children with CSSTransition. Ensures each child key gets its own CSSTransition instance to avoid state loss.

      Parameters

      • props: {
            activeKey: any;
            appear?: boolean;
            children: any[];
            classNames?: string;
            csstProps?: object;
            mode?: "out-in" | "in-out";
            mountOnEnter?: boolean;
            onEnter?: (isAppearing: boolean) => void;
            onEntered?: (isAppearing: boolean) => void;
            onExited?: (isAppearing: boolean) => void;
            onExiting?: (isAppearing: boolean) => void;
            timeout?: number;
            unmountOnExit?: boolean;
        }
        • activeKey: any

          The key of the currently active child.

        • Optionalappear?: boolean

          Whether to run the initial transition on first mount.

        • children: any[]

          The set of children to switch between. Each child should have a stable key (or your key will fall back to its index).

        • OptionalclassNames?: string

          Base className(s) used by CSSTransition to apply enter/exit classes.

        • OptionalcsstProps?: object

          Any additional props are forwarded to each CSSTransition instance.

        • Optionalmode?: "out-in" | "in-out"

          Controls sequencing when activeKey changes:

          • "out-in": outgoing transitions out first, incoming transitions in after exit completes.
          • "in-out": incoming transitions in first, outgoing transitions out after the incoming finishes entering (relies on onEntered).
        • OptionalmountOnEnter?: boolean

          Whether to mount the transitioning child only when it begins entering.

        • OptionalonEnter?: (isAppearing: boolean) => void

          Called when a child begins entering.

        • OptionalonEntered?: (isAppearing: boolean) => void

          Called when a child finishes entering. Used to implement "in-out" sequencing.

        • OptionalonExited?: (isAppearing: boolean) => void

          Called when the outgoing child finishes exiting.

        • OptionalonExiting?: (isAppearing: boolean) => void

          Called when a child begins exiting.

        • Optionaltimeout?: number

          Transition timeout passed to each CSSTransition.

        • OptionalunmountOnExit?: boolean

          Whether to unmount the child after it finishes exiting.

      Returns HTMLComponent