Skip to content

Commit e310d01

Browse files
committed
fix(modal): to work during rerenders
1 parent 0471c04 commit e310d01

1 file changed

Lines changed: 1 addition & 3 deletions

File tree

src/components/Modal/ModalBase.web.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,7 @@ export const ModalBase = (props: ModalBaseProps): React.ReactPortal | null => {
7171
}, [visible]);
7272

7373
const { opacity, y } = useSpring({
74-
onRest: () => {
75-
if (!visible) setIsInView(false);
76-
},
74+
onRest: () => !visible && isInView && setIsInView(false),
7775

7876
config: springDefaultConfig,
7977

0 commit comments

Comments
 (0)