@octopusdeploy/design-system-components
Version:
The design systems component library.
21 lines (20 loc) • 1.27 kB
TypeScript
import type { TransitionProps } from "@mui/material/transitions";
import type { PropsWithChildren } from "react";
import React from "react";
export declare function OverrideTransitionComponents(props: PropsWithChildren<{
transitionComponent: React.ComponentType<TransitionProps>;
}>): import("react/jsx-runtime").JSX.Element;
export declare function useTransitionComponentOverride(): React.ComponentType<TransitionProps> | null;
/**
* This component can be used in place of a Material-ui transition component. It is designed to be used during testing
* It does not invoke the onEnter/onExit/etc. callbacks of a normal transition component and instead always renders its children
* This makes it ideal for testing
* Some components (eg Modal from material-ui) will unmount their children asynchronously due to their usage of Transitions
* By providing a custom component that does not invoke any of the on* methods from other transitions, we can bypass this logic
* and force components like Modal to unmount their children synchronously
* @param props
* @constructor
*/
export declare const DefaultTransitionComponent: React.ForwardRefExoticComponent<TransitionProps & {
children?: React.ReactNode | undefined;
} & React.RefAttributes<HTMLDivElement>>;