Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

fix: warning on bypass visible value in switch button (#1607)

Himself6537a135d49e5c
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',
+ };
+});