MCPcopy
hub / github.com/react-native-modal/react-native-modal / constructor

Method constructor

src/modal.tsx:210–233  ·  view source on GitHub ↗
(props: ModalProps)

Source from the content-addressed store, hash-verified

208 interactionHandle: OrNull<number> = null;
209
210 constructor(props: ModalProps) {
211 super(props);
212 const {animationIn, animationOut} = buildAnimations(
213 extractAnimationFromProps(props),
214 );
215
216 this.animationIn = animationIn;
217 this.animationOut = animationOut;
218
219 if (this.state.isSwipeable) {
220 this.state = {
221 ...this.state,
222 pan: new Animated.ValueXY(),
223 };
224 this.buildPanResponder();
225 }
226 if (props.isVisible) {
227 this.state = {
228 ...this.state,
229 isVisible: true,
230 showContent: true,
231 };
232 }
233 }
234
235 static getDerivedStateFromProps(nextProps: Readonly<ModalProps>, state: State) {
236 if (!state.isVisible && nextProps.isVisible) {

Callers

nothing calls this directly

Calls 2

buildAnimationsFunction · 0.90

Tested by

no test coverage detected