An opinionated toast component for React.
chore: rename container prop to cssContainer (#649)
Emil Kowalski0011974b66ac
diff --git a/src/index.tsx b/src/index.tsxindex cdf6a1c..1980b16 100644--- a/src/index.tsx+++ b/src/index.tsx@@ -618,7 +618,7 @@ const Toaster = React.forwardRef<HTMLElement, ToasterProps>(function Toaster(progap = GAP,icons,containerAriaLabel = 'Notifications',- container,+ cssContainer,} = props;const [toasts, setToasts] = React.useState<ToastT[]>([]);const possiblePositions = React.useMemo(() => {@@ -656,9 +656,9 @@ const Toaster = React.forwardRef<HTMLElement, ToasterProps>(function Toaster(proReact.useEffect(() => {if (typeof document !== 'undefined') {- insertCSS(container ?? document.body, globalStyle);+ insertCSS(cssContainer ?? document.body, globalStyle);}- }, [container]);+ }, [cssContainer]);React.useEffect(() => {return ToastState.subscribe((toast) => {diff --git a/src/types.ts b/src/types.tsindex 501d746..98230ac 100644--- a/src/types.ts+++ b/src/types.ts@@ -142,7 +142,7 @@ export interface ToasterProps {swipeDirections?: SwipeDirection[];icons?: ToastIcons;containerAriaLabel?: string;- container?: HTMLElement | null;+ cssContainer?: HTMLElement | null;}export type SwipeDirection = 'top' | 'right' | 'bottom' | 'left';