diff --git a/apps/web/src/components/affine/sidebar-switch/style.ts b/apps/web/src/components/affine/sidebar-switch/style.ts index b0f26b2314..a582f1f68e 100644 --- a/apps/web/src/components/affine/sidebar-switch/style.ts +++ b/apps/web/src/components/affine/sidebar-switch/style.ts @@ -1,10 +1,12 @@ import { IconButton, styled } from '@affine/component'; -export const StyledSidebarSwitch = styled(IconButton)<{ visible: boolean }>( - ({ visible }) => { - return { - opacity: visible ? 1 : 0, - transition: 'all 0.2s ease-in-out', - }; - } -); +export const StyledSidebarSwitch = styled(IconButton, { + shouldForwardProp(propName: PropertyKey) { + return propName !== 'visible'; + }, +})<{ visible: boolean }>(({ visible }) => { + return { + opacity: visible ? 1 : 0, + transition: 'all 0.2s ease-in-out', + }; +});