import React, { ReactElement, ReactNode, Suspense } from "react"; type Props = { children: ReactNode; fallback: ReactNode; }; const SafeSuspense = ({ children, fallback }: Props): ReactElement => { const IS_TEST_RUNNER = window.navigator.userAgent.match( /StorybookTestRunner/ ); return IS_TEST_RUNNER ? ( <>{fallback} ) : ( {children} ); }; export default SafeSuspense;