diff --git a/frontend/src/AppBuilder/Viewer/Viewer.jsx b/frontend/src/AppBuilder/Viewer/Viewer.jsx index e8a04aab0b..afea59a52c 100644 --- a/frontend/src/AppBuilder/Viewer/Viewer.jsx +++ b/frontend/src/AppBuilder/Viewer/Viewer.jsx @@ -61,7 +61,8 @@ export const Viewer = ({ id: appId, darkMode, moduleId = 'canvas', switchDarkMod }), shallow ); - const currentPageComponents = useStore((state) => state.getCurrentPageComponents(), shallow); + const getCurrentPageComponents = useStore((state) => state.getCurrentPageComponents(), shallow); + const currentPageComponents = useMemo(() => getCurrentPageComponents, [getCurrentPageComponents]); const isPagesSidebarHidden = useStore((state) => state.getPagesSidebarVisibility('canvas'), shallow); const canvasBgColor = useStore((state) => state.getCanvasBackgroundColor('canvas', darkMode), shallow);