Skip to content

Commit fc73c24

Browse files
refactor(web): sidebar resize options stay cached without "use memo" (pingdotgg#20776)
Co-authored-by: Claude Opus 5.5 <[email protected]>
1 parent 36cde6f commit fc73c24

1 file changed

Lines changed: 3 additions & 4 deletions

File tree

‎apps/web/src/components/ui/sidebar.tsx‎

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,7 @@ function SidebarProvider({
177177
);
178178
}
179179

180-
/** The rail's width restore and drag refresh key on this value. */
181-
function useResolvedSidebarResizable({
180+
function resolveSidebarResizable({
182181
collapsible,
183182
isMobile,
184183
resizable,
@@ -187,7 +186,6 @@ function useResolvedSidebarResizable({
187186
isMobile: boolean;
188187
resizable: boolean | SidebarResizableOptions;
189188
}): SidebarResolvedResizableOptions | null {
190-
"use memo";
191189
if (isMobile || collapsible === "none" || !resizable) {
192190
return null;
193191
}
@@ -217,7 +215,8 @@ function Sidebar({
217215
resizable?: boolean | SidebarResizableOptions;
218216
}) {
219217
const { isMobile, state, openMobile, setOpenMobile, setMobileSheetElement } = useSidebar();
220-
const resolvedResizable = useResolvedSidebarResizable({ collapsible, isMobile, resizable });
218+
// The rail's width restore and drag refresh key on this value.
219+
const resolvedResizable = resolveSidebarResizable({ collapsible, isMobile, resizable });
221220
const instanceContextValue: SidebarInstanceContextProps = { side, resizable: resolvedResizable };
222221

223222
if (collapsible === "none") {

0 commit comments

Comments
 (0)