mirror of
https://github.com/hanzo-docs/docs.git
synced 2026-10-26 23:49:51 +00:00
Core: Remove minWidth deprecated option
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
---
|
||||
'fumadocs-core': major
|
||||
---
|
||||
|
||||
Remove `minWidth` deprecated option
|
||||
|
||||
migrate: Use `blockScrollingWidth` instead
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user