Skip to content

Commit c6fe7e6

Browse files
committed
(chore): isOpen prop changed to startOpen
1 parent 4dd4ab5 commit c6fe7e6

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/components/animatedModal/AnimatedModal.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ import { ModalAnimation } from './AnimatedModal.enums';
77
/**
88
* Animated Modal's props.
99
* @interface IAnimatedModalProps
10-
* @property {boolean} [isOpen] Is modal open?
10+
* @property {boolean} [startOpen] Is modal open?
1111
* @property {ModalAnimation} animation Modal animation
1212
* @property {React.ReactNode} [children] Modal's children
1313
* @property {boolean} [closeOnBackgroundClick] Close modal on background click?
1414
*/
1515
interface IAnimatedModalProps {
16-
isOpen?: boolean;
16+
startOpen?: boolean;
1717
animation: ModalAnimation;
1818
children?: React.ReactNode;
1919
closeOnBackgroundClick?: boolean;
@@ -115,11 +115,11 @@ const AnimatedModal = forwardRef(
115115
}
116116

117117
useEffect(() => {
118-
if (props.isOpen) {
118+
if (props.startOpen) {
119119
setModalClass(props.animation);
120120
document.body.classList.add('modal-active');
121121
}
122-
}, [props.isOpen]);
122+
}, [props.startOpen]);
123123

124124
/**
125125
* Default modal.
@@ -166,7 +166,7 @@ AnimatedModal.displayName = 'AnimatedModal';
166166

167167
// Set default props
168168
AnimatedModal.defaultProps = {
169-
isOpen: false,
169+
startOpen: false,
170170
animation: ModalAnimation.Unfold,
171171
closeOnBackgroundClick: true
172172
};

0 commit comments

Comments
 (0)