Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update layout transitions docs #6275

Merged
merged 2 commits into from
Jul 16, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,26 +16,26 @@ To be precise how to animate positions and dimensions of components. What's impo
### 1. Import chosen transition

```js
// Transition is just an example and should be replaced by real animation. For Instance Layout
import { Transition } from 'react-native-reanimated';
// LinearTransition is just an example and should be replaced by real animation. For Instance Layout
import { LinearTransition } from 'react-native-reanimated';
```

### 2. Choose Animated Component which layout you want to animate

```js
// AnimatedComponent - component created by createAnimatedComponent or imported from Reanimated
<AnimatedComponent layout={Transition} >
<AnimatedComponent layout={LinearTransition} >
```

### 3. Customize the animation

Different type of layout transitions can be customized differently. For the complete list of option please refer to the paragraph specific to the particular animation type. We recommend using builders outside of components or with `useMemo` to ensure the best performance.

```js
const transition = Transition.duration(3000).otherModifier();
const transition = LinearTransition.duration(3000).otherModifier();

function App() {
return <AnimatedComponent layout={transition} />;
return <AnimatedComponent layout={LinearTransition} />;
piaskowyk marked this conversation as resolved.
Show resolved Hide resolved
}
```

Expand Down
Loading