mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-08-07 20:31:33 +08:00
fix(web): hydration issue (#2974)
This commit is contained in:
@@ -28,6 +28,7 @@ import { SidebarHeader } from './sidebar-header';
|
|||||||
export type AppSidebarProps = PropsWithChildren<
|
export type AppSidebarProps = PropsWithChildren<
|
||||||
SidebarHeaderProps & {
|
SidebarHeaderProps & {
|
||||||
hasBackground?: boolean;
|
hasBackground?: boolean;
|
||||||
|
isFallback?: boolean;
|
||||||
}
|
}
|
||||||
>;
|
>;
|
||||||
|
|
||||||
@@ -52,7 +53,7 @@ export function AppSidebar(props: AppSidebarProps): ReactElement {
|
|||||||
const [appSidebarFloating, setAppSidebarFloating] = useAtom(
|
const [appSidebarFloating, setAppSidebarFloating] = useAtom(
|
||||||
appSidebarFloatingAtom
|
appSidebarFloatingAtom
|
||||||
);
|
);
|
||||||
const initialRender = open === undefined;
|
const initialRender = open === undefined && !props.isFallback;
|
||||||
|
|
||||||
const isResizing = useAtomValue(appSidebarResizingAtom);
|
const isResizing = useAtomValue(appSidebarResizingAtom);
|
||||||
const navRef = useRef<HTMLDivElement>(null);
|
const navRef = useRef<HTMLDivElement>(null);
|
||||||
@@ -126,7 +127,7 @@ export function AppSidebar(props: AppSidebarProps): ReactElement {
|
|||||||
|
|
||||||
export const AppSidebarFallback = (): ReactElement | null => {
|
export const AppSidebarFallback = (): ReactElement | null => {
|
||||||
return (
|
return (
|
||||||
<AppSidebar>
|
<AppSidebar isFallback>
|
||||||
<div className={fallbackStyle}>
|
<div className={fallbackStyle}>
|
||||||
<div className={fallbackHeaderStyle}>
|
<div className={fallbackHeaderStyle}>
|
||||||
<Skeleton variant="circular" width={40} height={40} />
|
<Skeleton variant="circular" width={40} height={40} />
|
||||||
|
|||||||
Reference in New Issue
Block a user