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

This commit is contained in:
Himself65
2023-03-18 01:03:32 -04:00
committed by GitHub
parent 74fc43020a
commit 37a135d49e

View File

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