import 'tailwindcss/tailwind.css' import UIState from 'libs/web/state/ui' import { AppProps } from 'next/app' import Head from 'next/head' import { ThemeProvider, useTheme } from 'next-themes' import { StylesProvider } from '@material-ui/styles' import PortalState from 'libs/web/state/portal' import Div100vh from 'react-div-100vh' import { createMuiTheme, MuiThemeProvider } from '@material-ui/core' import { useMemo } from 'react' const handleRejection = (event: any) => { // react-beautiful-dnd 会捕获到 `ResizeObserver loop limit exceeded` // 但实际这个错误对性能没有影响 // see https://github.com/atlassian/react-beautiful-dnd/issues/1548 if (/^ResizeObserver/.test(event.message)) { // todo catch event.stopImmediatePropagation() } if (event.reason === 'canceled') { event.preventDefault() } } if (typeof window !== 'undefined') { window.addEventListener('unhandledrejection', handleRejection) window.addEventListener('error', handleRejection) } function DocumentHead() { const { title } = UIState.useContainer() return (