overleaf/services/web/frontend/js/features/ide-react/components/ide-root.tsx
Alf Eaton a074054cc9 Add memo to some components (#16094)
GitOrigin-RevId: e4bea140d872ac3f8b2aca7833e658af684a1438
2023-12-15 09:03:22 +00:00

18 lines
709 B
TypeScript

import { FC, memo, useState } from 'react'
import { GenericErrorBoundaryFallback } from '@/shared/components/generic-error-boundary-fallback'
import withErrorBoundary from '@/infrastructure/error-boundary'
import IdePage from '@/features/ide-react/components/layout/ide-page'
import { ReactContextRoot } from '@/features/ide-react/context/react-context-root'
import { Loading } from '@/features/ide-react/components/loading'
const IdeRoot: FC = () => {
const [loaded, setLoaded] = useState(false)
return (
<ReactContextRoot>
{loaded ? <IdePage /> : <Loading setLoaded={setLoaded} />}
</ReactContextRoot>
)
}
export default withErrorBoundary(memo(IdeRoot), GenericErrorBoundaryFallback)