Skip to content

Entering & Existing Transitions Help #5857

Answered by MatiPl01
ShaneKeney asked this question in Q&A

You must be logged in to vote

Hey!

Here is the example solution for this problem. You would have to use the layout property for all siblings of the component which is animated with entering/exiting transition.

Below you can see the adapted code to match your implementation and the result:

import React, { useState } from 'react';
import Animated, {
  LinearTransition,
  SlideInLeft,
  SlideOutRight,
  Easing,
} from 'react-native-reanimated';
import { Button, StyleSheet, Text } from 'react-native';

export default function EmptyExample() {
  const [show, setShow] = useState(false);

  const duration = 500;

  return (
    <>
      {show && (
        <Animated.View
          layout={LinearTransition}
          exiting={S…

Replies: 1 comment 1 reply

You must be logged in to vote
1 reply
@MatiPl01

Answer selected by MatiPl01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants