Skip to content

armgit / meet

Public Imported from GitHub
0

Open source video conferencing app powered by LiveKit. Built with Django and React.

🐛(frontend) have a suspense fallback

Emmanuel Pelletiere04b8d081fa1
diff --git a/src/frontend/src/App.tsx b/src/frontend/src/App.tsx
index 128da3f5..6d7f4956 100644
--- a/src/frontend/src/App.tsx
+++ b/src/frontend/src/App.tsx
@@ -1,13 +1,15 @@
import '@livekit/components-styles'
import '@/styles/index.css'
+import { Suspense } from 'react'
import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
import { useTranslation } from 'react-i18next'
import { useLang } from 'hoofd'
import { Route, Switch } from 'wouter'
+import { Screen } from './layout/Screen'
import { HomeRoute } from '@/features/home'
-import { NotFound } from './routes/NotFound'
import { RoomRoute, roomIdRegex } from '@/features/rooms'
+import { NotFound } from './routes/NotFound'
import './i18n/init'
const queryClient = new QueryClient()
@@ -17,12 +19,14 @@ function App() {
useLang(i18n.language)
return (
<QueryClientProvider client={queryClient}>
- <Switch>
- <Route path="/" component={HomeRoute} />
- <Route path={roomIdRegex} component={RoomRoute} />
- <Route component={NotFound} />
- </Switch>
- <ReactQueryDevtools initialIsOpen={false} />
+ <Suspense fallback={<Screen />}>
+ <Switch>
+ <Route path="/" component={HomeRoute} />
+ <Route path={roomIdRegex} component={RoomRoute} />
+ <Route component={NotFound} />
+ </Switch>
+ <ReactQueryDevtools initialIsOpen={false} />
+ </Suspense>
</QueryClientProvider>
)
}
diff --git a/src/frontend/src/layout/Screen.tsx b/src/frontend/src/layout/Screen.tsx
index f9bc4d0f..777d1b58 100644
--- a/src/frontend/src/layout/Screen.tsx
+++ b/src/frontend/src/layout/Screen.tsx
@@ -2,7 +2,7 @@ import type { ReactNode } from 'react'
import { css } from '@/styled-system/css'
import { Header } from './Header'
-export const Screen = ({ children }: { children: ReactNode }) => {
+export const Screen = ({ children }: { children?: ReactNode }) => {
return (
<div
className={css({