Skip to content

Commit 1342e11

Browse files
committed
fix(routes): trigger lazy loading only once
1 parent f720ff5 commit 1342e11

2 files changed

Lines changed: 10 additions & 9 deletions

File tree

frontend/src/App.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ import { createWebSocket, WebSocketContext } from './api/api-websockets';
99
import { useThemeClass } from './theme';
1010
import { FC } from 'react';
1111

12-
const WithUser: FC = () => {
13-
const Changelog = lazy(() => import('./Changelog'));
14-
const CreateParty = lazy(() => import('./party/create/CreateParty'));
15-
const ViewParty = lazy(() => import('./party/view/ViewParty'));
16-
const EditParty = lazy(() => import('./party/edit/EditParty'));
17-
const OwnSubmissions = lazy(() => import('./party/submissions/OwnSubmissions'));
18-
const EditProfile = lazy(() => import('./user/EditProfile'));
19-
const Home = lazy(() => import('./home/Home'));
12+
const Changelog = lazy(() => import('./Changelog'));
13+
const CreateParty = lazy(() => import('./party/create/CreateParty'));
14+
const ViewParty = lazy(() => import('./party/view/ViewParty'));
15+
const EditParty = lazy(() => import('./party/edit/EditParty'));
16+
const OwnSubmissions = lazy(() => import('./party/submissions/OwnSubmissions'));
17+
const EditProfile = lazy(() => import('./user/EditProfile'));
18+
const Home = lazy(() => import('./home/Home'));
2019

20+
const WithUser: FC = () => {
2121
return (
2222
<Suspense fallback={<span></span>}>
2323
<Routes>

frontend/src/components/ReactionPicker.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ import { FunctionComponent, lazy, Suspense, useCallback, useState } from 'react'
22
import { FaRegWindowMaximize, FaRegWindowMinimize } from 'react-icons/fa';
33
import { useAppState } from '../user/appState';
44

5+
const EmojiPicker = lazy(() => import('react-input-emoji'));
6+
57
const ReactionPicker: FunctionComponent<{ onReaction: (reaction: string) => void }> = ({ onReaction }) => {
68
const [appState, setAppState] = useAppState();
79
const [textInput, setTextInput] = useState('');
8-
const EmojiPicker = lazy(() => import('react-input-emoji'));
910

1011
const onTextSubmit = useCallback(
1112
(text: string) => {

0 commit comments

Comments
 (0)