From 3ff7ace54ea327c54732900174b590f868dfcfae Mon Sep 17 00:00:00 2001 From: Yash Joshi Date: Sat, 5 Jun 2021 12:38:37 +0530 Subject: [PATCH] fix: suspense for lazy loaded pages Add suspense to track the route splitted modules, this will make sure that the sidebar and navbar is not unmounted whenever modules start fetching. --- frontend/src/modules/AppWrapper.tsx | 62 ++++++++++++++++------------- 1 file changed, 34 insertions(+), 28 deletions(-) diff --git a/frontend/src/modules/AppWrapper.tsx b/frontend/src/modules/AppWrapper.tsx index 11e53cd04d..26741a2f9b 100644 --- a/frontend/src/modules/AppWrapper.tsx +++ b/frontend/src/modules/AppWrapper.tsx @@ -33,34 +33,40 @@ const App = () => { - - - - - - - - - - { - return localStorage.getItem(IS_LOGGED_IN) === "yes" ? ( - - ) : ( - - ); - }} - /> + }> + + + + + + + + + + { + return localStorage.getItem(IS_LOGGED_IN) === "yes" ? ( + + ) : ( + + ); + }} + /> +