Skip to content

Commit

Permalink
remove suspense
Browse files Browse the repository at this point in the history
  • Loading branch information
JackBlake-zkq committed Apr 23, 2024
1 parent 27d3360 commit 1161b49
Showing 1 changed file with 14 additions and 12 deletions.
26 changes: 14 additions & 12 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
import React, { lazy, Suspense, useEffect, useState } from 'react'
import React, { useEffect, useState } from 'react'
import { BrowserRouter as Router, Routes, Route } from 'react-router-dom'
import { initializeApp } from 'firebase/app'
import { getAuth } from 'firebase/auth'
import 'leaflet/dist/leaflet.css'
import LoadingOverlay from 'components/LoadingOverlay'
import Home from 'components/Home'
import Login from 'components/Login'
import CRUDDash from 'components/CRUDDash'

const App: React.FC = () => {
const app = initializeApp({
Expand All @@ -30,9 +32,9 @@ const App: React.FC = () => {
setIsLoggedIn(true) // Update the sign-in status to true
}

const Home = lazy(() => import('components/Home'))
const Login = lazy(() => import('components/Login'))
const CRUDDash = lazy(() => import('components/CRUDDash'))
// const Home = lazy(() => import('components/Home'))
// const Login = lazy(() => import('components/Login'))
// const CRUDDash = lazy(() => import('components/CRUDDash'))

function Admin() {
return (
Expand All @@ -54,13 +56,13 @@ const App: React.FC = () => {

return (
<Router>
<Suspense fallback={<LoadingOverlay isVisible={true} color="#ab0000" />}>
<Routes>
<Route path="/" element={<Home app={app} isAdmin={false} />} />
<Route path="/admin" element={<Admin />} />
<Route path="/admin/dash" element={<AdminDash />} />
</Routes>
</Suspense>
{/* <Suspense fallback={<LoadingOverlay isVisible={true} color="#ab0000" />}> */}
<Routes>
<Route path="/" element={<Home app={app} isAdmin={false} />} />
<Route path="/admin" element={<Admin />} />
<Route path="/admin/dash" element={<AdminDash />} />
</Routes>
{/* </Suspense> */}
</Router>
)
}
Expand Down

0 comments on commit 1161b49

Please sign in to comment.