1 year ago

#182204

test-img

Amit chakraborty

how can we reconfigure modals using react-native-modalfy separately?

how can we reconfigure modals using react-native-modalfy separately?

like in App.tsx i have configured modal like this below.

I want to change position and animation style for DemoModal2.

import { createModalStack } from 'react-native-modalfy';

const { height } = Dimensions.get('screen');

export const ModalStack = createModalStack({
 demo1:DemoModal1,
 demo2:DemoModal2
 }, {
    animateInConfig: {
    easing: Easing.inOut(Easing.exp),
    duration: 900,
},
animateOutConfig: {
    easing: Easing.inOut(Easing.exp),
    duration: 900,
},
backdropOpacity: 0.6,
position: 'top',

transitionOptions: (animatedValue) => ({
    transform: [
        {
            translateY: animatedValue.interpolate({
                inputRange: [0, 1, 2],
                outputRange: [height, 0, height],
            }),
        },
        {
            scale: animatedValue.interpolate({
                inputRange: [0, 1, 2],
                outputRange: [0, 1, 0.9],
            }),
        },
    ],
}),
});

similarly there will be more modals. So i need some examples..

react-native

react-native-modal

0 Answers

Your Answer

Accepted video resources