2

I have a view and it contains some description of current question, When userclick next button question index incremented UI changes immediately as expected,

Instead of instant change, trying to make transition like changing screen with react navigation. New screen with content should slide from right side and cover the screen like navigation..

How can I achieve this?

import {
  ViewStyle,
  View,
  Animated,
  Platform,
} from 'react-native'

const [fadeAnimation, setfadeAnimation] = useState(new Animated.Value(0))

  const fadeIn = () => {
    Animated.timing(fadeAnimation, {
      toValue: 1,
      duration: 4000,
      useNativeDriver: true,
    }).start()
  }

const onClickNext = () => {
    setActiveIndex(activeIndex + 1)
    fadeIn()
}

    return (
     <Animated.View style={{
                ...FULL,
                transform: [{ translateX: fadeAnimation }],
              }}
            >
    ...
    <Text>{ActiveQuestionText}</Text>
    
    )
TyForHelpDude
  • 4,828
  • 10
  • 48
  • 96

0 Answers0