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-6.x/shared-element-transitions.md
+10-8Lines changed: 10 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ Shared Element Transitions are an experimental feature not recommended for produ
9
9
**Architecture support:**
10
10
11
11
-**Reanimated 3** supports Shared Element Transitions on the **Old Architecture** (Paper).
12
-
-**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.
12
+
-**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.
13
13
14
14
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)
Before continuing this guide make sure your app meets these criteria:
25
25
26
-
- 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).
26
+
- You are using [`@react-navigation/native-stack`](native-stack-navigator.md). JS-based [`@react-navigation/stack`](stack-navigator.md) or other navigators are not supported.
27
27
- You have [`react-native-reanimated`](https://docs.swmansion.com/react-native-reanimated/docs/fundamentals/getting-started)**v3.0.0 or higher** installed and configured.
28
28
- 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).
29
29
@@ -104,24 +104,25 @@ You can customize the transition by passing a custom `SharedTransition` configur
104
104
105
105
Custom transition configuration is not fully finalized and might change in a future release.
106
106
107
-
:::
108
-
109
107
### Old Architecture (Reanimated 3)
110
108
111
109
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()`:
Copy file name to clipboardExpand all lines: versioned_docs/version-7.x/shared-element-transitions.md
+11-91Lines changed: 11 additions & 91 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,7 +16,7 @@ Shared Element Transitions are an experimental feature not recommended for produ
16
16
**Architecture support:**
17
17
18
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.
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
20
21
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)
Before continuing this guide make sure your app meets these criteria:
32
32
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).
33
+
- You are using [`@react-navigation/native-stack`](native-stack-navigator.md). JS-based [`@react-navigation/stack`](stack-navigator.md) or other navigators are not supported.
34
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
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).
36
36
@@ -42,10 +42,7 @@ To create a shared transition:
42
42
2. Assign the same `sharedTransitionTag` to elements on different screens.
43
43
3. Navigate between screens. The transition will start automatically.
`sharedTransitionTag` is a string that has to be unique in the context of a single screen, but has to match elements between screens. This prop allows Reanimated to identify and animate the elements, similarly to the [`key`](https://react.dev/learn/rendering-lists#keeping-list-items-in-order-with-key) property, which tells React which element in the list is which.
189
113
190
114
## Customizing the transition
@@ -193,24 +117,25 @@ You can customize the transition by passing a custom `SharedTransition` configur
193
117
194
118
Custom transition configuration is not fully finalized and might change in a future release.
195
119
196
-
:::
197
-
198
120
### Old Architecture (Reanimated 3)
199
121
200
122
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()`:
@@ -254,10 +180,10 @@ You can find a full Shared Element Transitions reference in the [React Native Re
254
180
255
181
## Limitations
256
182
257
-
Shared Element Transitions have several current limitations to be aware of:
183
+
Shared Element Transitions currently have several limitations to be aware of:
258
184
259
-
- Only the native stack navigator is supported
260
-
-The Tab navigator is not supported
185
+
- Only the [native stack navigator](native-stack-navigator.md) is supported
186
+
-Other navigators such as JS stack, drawer, and bottom tabs are not supported
261
187
- Transitions with native modals don't work properly on iOS
262
188
263
189
### New Architecture specific limitations (Reanimated 4)
@@ -271,9 +197,3 @@ The following limitations apply specifically when using Reanimated 4 on the New
271
197
- On iOS, you may encounter issues with vertical positioning due to header height information propagation
272
198
273
199
The limitations will be addressed in future Reanimated releases.
274
-
275
-
## Alternatives
276
-
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.
278
-
279
-
The [`react-native-navigation`](https://github.com/wix/react-native-navigation) also comes with support for Shared Element Transitions. You can read more about it [here](https://wix.github.io/react-native-navigation/docs/style-animations#shared-element-transitions).
0 commit comments