Core: Remove minWidth deprecated option

This commit is contained in:
fuma-nama
2024-06-07 17:54:12 +08:00
parent c11004034c
commit 98430e9e6e
2 changed files with 8 additions and 14 deletions
+7
View File
@@ -0,0 +1,7 @@
---
'fumadocs-core': major
---
Remove `minWidth` deprecated option
migrate: Use `blockScrollingWidth` instead
+1 -14
View File
@@ -1,4 +1,3 @@
import { usePathname } from 'next/navigation';
import {
useCallback,
createContext,
@@ -37,12 +36,6 @@ export function SidebarProvider(
props.onOpenChange ?? setOpenInner,
];
const pathname = usePathname();
useEffect(() => {
setOpen(false);
}, [pathname, setOpen]);
return (
<SidebarContext.Provider value={[open, setOpen]}>
{props.children}
@@ -79,11 +72,6 @@ export function SidebarTrigger<T extends ElementType = 'button'>({
}
export type SidebarContentProps<T extends ElementType> = AsProps<T> & {
/**
* @deprecated Use `blockScrollingWidth` instead
*/
minWidth?: number;
/**
* Disable scroll blocking when the viewport width is larger than a certain number (in pixels)
*/
@@ -93,8 +81,7 @@ export type SidebarContentProps<T extends ElementType> = AsProps<T> & {
// todo: Change in next major
export function SidebarList<T extends ElementType = 'aside'>({
as,
minWidth,
blockScrollingWidth = minWidth,
blockScrollingWidth,
...props
}: SidebarContentProps<T>): ReactElement {
const [open] = useSidebarContext();