You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/shared-element-transitions.md
+59-9Lines changed: 59 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,9 +11,14 @@ This guide covers how to animate elements between screens. This feature is known
11
11
12
12
:::warning
13
13
14
-
As of writing this guide, Shared Element Transitions are considered an experimental feature not recommended for production use.
14
+
Shared Element Transitions are an experimental feature not recommended for production use yet.
15
15
16
-
Shared Element Transitions are currently only supported on **old React Native architecture** (Paper).
16
+
**Architecture support:**
17
+
18
+
-**Reanimated 3** supports Shared Element Transitions on the **Old Architecture** (Paper).
19
+
-**Reanimated 4** supports them on the **New Architecture** (Fabric) since 4.2.0, but the feature is behind a feature flag. You need to [enable the `ENABLE_SHARED_ELEMENT_TRANSITIONS` feature flag](https://docs.swmansion.com/react-native-reanimated/docs/guides/feature-flags#enable_shared_element_transitions) to use it.
20
+
21
+
Check [the Reanimated documentation](https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/overview/) for details and [send feedback to the Reanimated team](https://github.com/software-mansion/react-native-reanimated)
17
22
18
23
:::
19
24
@@ -27,6 +32,7 @@ Before continuing this guide make sure your app meets these criteria:
27
32
28
33
- You are using [`@react-navigation/native-stack`](native-stack-navigator.md). The Shared Element Transitions feature isn't supported in JS-based [`@react-navigation/stack`](stack-navigator.md).
29
34
- You have [`react-native-reanimated`](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started)**v3.0.0 or higher** installed and configured.
35
+
- If you are using **Reanimated 4** (New Architecture), you must [enable the `ENABLE_SHARED_ELEMENT_TRANSITIONS` feature flag](https://docs.swmansion.com/react-native-reanimated/docs/guides/feature-flags#enable_shared_element_transitions).
By default, the transition animates the `width`, `height`, `originX`, `originY` and `transform` properties using `withTiming` with a 500 ms duration. You can easily customize `width`, `height`, `originX`, and `originY` props. Customizing `transform` is also possible but it's far beyond the scope of this guide.
187
-
188
-
:::warning
192
+
You can customize the transition by passing a custom `SharedTransition` configuration via the `sharedTransitionStyle` prop. Apply the same `sharedTransitionStyle` to the matching element on the target screen.
189
193
190
-
Custom SharedTransition API is not finalized and might change in a future release.
194
+
Custom transition configuration is not fully finalized and might change in a future release.
191
195
192
196
:::
193
197
194
-
To customize the transition you need to pass all the properties besides `transform`.
198
+
### Old Architecture (Reanimated 3)
199
+
200
+
By default, the transition animates `width`, `height`, `originX`, `originY`, and `transform` using `withTiming` with a 500 ms duration. You can customize the transition using `SharedTransition.custom()`:
sharedTransitionStyle={customTransition} // add this to both elements on both screens
221
+
sharedTransitionStyle={customTransition}
222
+
/>
223
+
);
224
+
}
225
+
```
226
+
227
+
### New Architecture (Reanimated 4)
228
+
229
+
On the New Architecture, the default transition animates `width`, `height`, `originX`, `originY`, `transform`, `backgroundColor`, and `opacity` using `withTiming` with a 500 ms duration.
230
+
231
+
Currently customization is more limited due to ongoing development. You can't define fully custom animation functions. Instead, use the `SharedTransition` builder class to configure duration and spring-based animations:
You can find a full Shared Element Transitions reference in the [React Native Reanimated documentation](https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/overview/).
224
254
255
+
## Limitations
256
+
257
+
Shared Element Transitions have several current limitations to be aware of:
258
+
259
+
- Only the native stack navigator is supported
260
+
- The Tab navigator is not supported
261
+
- Transitions with native modals don't work properly on iOS
262
+
263
+
### New Architecture specific limitations (Reanimated 4)
264
+
265
+
The following limitations apply specifically when using Reanimated 4 on the New Architecture:
266
+
267
+
- The feature must be enabled via the `ENABLE_SHARED_ELEMENT_TRANSITIONS` feature flag
268
+
- Custom animation functions are not supported; you can only customize duration and use spring-based animations
269
+
- Some properties (e.g., `backgroundColor`) are not supported in progress-based transitions (iOS back gesture)
270
+
- There are performance bottlenecks with transforms being recalculated too eagerly
271
+
- On iOS, you may encounter issues with vertical positioning due to header height information propagation
272
+
273
+
The limitations will be addressed in future Reanimated releases.
274
+
225
275
## Alternatives
226
276
227
277
Alternatively, you can use [`react-native-shared-element`](https://github.com/IjzerenHein/react-native-shared-element) library with a [React Navigation binding](https://github.com/IjzerenHein/react-navigation-shared-element) which implements Shared Element Transitions in a JS-based `@react-navigation/stack` navigator. This solution, however, isn't actively maintained.
Copy file name to clipboardExpand all lines: versioned_docs/version-8.x/shared-element-transitions.md
+59-9Lines changed: 59 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -11,9 +11,14 @@ This guide covers how to animate elements between screens. This feature is known
11
11
12
12
:::warning
13
13
14
-
As of writing this guide, Shared Element Transitions are considered an experimental feature not recommended for production use.
14
+
Shared Element Transitions are an experimental feature not recommended for production use yet.
15
15
16
-
Shared Element Transitions are currently only supported on **old React Native architecture** (Paper).
16
+
**Architecture support:**
17
+
18
+
-**Reanimated 3** supports Shared Element Transitions on the **Old Architecture** (Paper).
19
+
-**Reanimated 4** supports them on the **New Architecture** (Fabric) since 4.2.0, but the feature is behind a feature flag. You need to [enable the `ENABLE_SHARED_ELEMENT_TRANSITIONS` feature flag](https://docs.swmansion.com/react-native-reanimated/docs/guides/feature-flags#enable_shared_element_transitions) to use it.
20
+
21
+
Check [the Reanimated documentation](https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/overview/) for details and [send feedback to the Reanimated team](https://github.com/software-mansion/react-native-reanimated)
17
22
18
23
:::
19
24
@@ -27,6 +32,7 @@ Before continuing this guide make sure your app meets these criteria:
27
32
28
33
- You are using [`@react-navigation/native-stack`](native-stack-navigator.md). The Shared Element Transitions feature isn't supported in JS-based [`@react-navigation/stack`](stack-navigator.md).
29
34
- You have [`react-native-reanimated`](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started)**v3.0.0 or higher** installed and configured.
35
+
- If you are using **Reanimated 4** (New Architecture), you must [enable the `ENABLE_SHARED_ELEMENT_TRANSITIONS` feature flag](https://docs.swmansion.com/react-native-reanimated/docs/guides/feature-flags#enable_shared_element_transitions).
By default, the transition animates the `width`, `height`, `originX`, `originY` and `transform` properties using `withTiming` with a 500 ms duration. You can easily customize `width`, `height`, `originX`, and `originY` props. Customizing `transform` is also possible but it's far beyond the scope of this guide.
187
-
188
-
:::warning
192
+
You can customize the transition by passing a custom `SharedTransition` configuration via the `sharedTransitionStyle` prop. Apply the same `sharedTransitionStyle` to the matching element on the target screen.
189
193
190
-
Custom SharedTransition API is not finalized and might change in a future release.
194
+
Custom transition configuration is not fully finalized and might change in a future release.
191
195
192
196
:::
193
197
194
-
To customize the transition you need to pass all the properties besides `transform`.
198
+
### Old Architecture (Reanimated 3)
199
+
200
+
By default, the transition animates `width`, `height`, `originX`, `originY`, and `transform` using `withTiming` with a 500 ms duration. You can customize the transition using `SharedTransition.custom()`:
sharedTransitionStyle={customTransition} // add this to both elements on both screens
221
+
sharedTransitionStyle={customTransition}
222
+
/>
223
+
);
224
+
}
225
+
```
226
+
227
+
### New Architecture (Reanimated 4)
228
+
229
+
On the New Architecture, the default transition animates `width`, `height`, `originX`, `originY`, `transform`, `backgroundColor`, and `opacity` using `withTiming` with a 500 ms duration.
230
+
231
+
Currently customization is more limited due to ongoing development. You can't define fully custom animation functions. Instead, use the `SharedTransition` builder class to configure duration and spring-based animations:
You can find a full Shared Element Transitions reference in the [React Native Reanimated documentation](https://docs.swmansion.com/react-native-reanimated/docs/shared-element-transitions/overview/).
224
254
255
+
## Limitations
256
+
257
+
Shared Element Transitions have several current limitations to be aware of:
258
+
259
+
- Only the native stack navigator is supported
260
+
- The Tab navigator is not supported
261
+
- Transitions with native modals don't work properly on iOS
262
+
263
+
### New Architecture specific limitations (Reanimated 4)
264
+
265
+
The following limitations apply specifically when using Reanimated 4 on the New Architecture:
266
+
267
+
- The feature must be enabled via the `ENABLE_SHARED_ELEMENT_TRANSITIONS` feature flag
268
+
- Custom animation functions are not supported; you can only customize duration and use spring-based animations
269
+
- Some properties (e.g., `backgroundColor`) are not supported in progress-based transitions (iOS back gesture)
270
+
- There are performance bottlenecks with transforms being recalculated too eagerly
271
+
- On iOS, you may encounter issues with vertical positioning due to header height information propagation
272
+
273
+
The limitations will be addressed in future Reanimated releases.
274
+
225
275
## Alternatives
226
276
227
277
Alternatively, you can use [`react-native-shared-element`](https://github.com/IjzerenHein/react-native-shared-element) library with a [React Navigation binding](https://github.com/IjzerenHein/react-navigation-shared-element) which implements Shared Element Transitions in a JS-based `@react-navigation/stack` navigator. This solution, however, isn't actively maintained.
0 commit comments