Skip to content

Conversation

@bartlomiejbloniarz
Copy link
Contributor

@bartlomiejbloniarz bartlomiejbloniarz commented Oct 15, 2025

Description

add snapshotAfterUpdates property to RNSScreenView. This is done for the sake of integration with reanimated (SETs), where reaniamted needs to make sure that some of the updates are applied before we take the snapshot.

Caution

This is not a part of public API, rather an internal one.

Test code and steps to reproduce

The default behaviour should be as before - if not modified, the snapshot should be taken before view updates.

Checklist

  • Ensured that CI passes

@kkafar kkafar changed the title Add snapshotAfterUpdates property to RNSScreenView feat: add snapshotAfterUpdates property to RNSScreenView Nov 4, 2025
Copy link
Member

@kkafar kkafar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks.

I've updated PR description.

Let's wait for the CI to pass & we'll land it.

@kkafar kkafar merged commit ef3c0d1 into main Nov 4, 2025
6 checks passed
@kkafar kkafar deleted the @bartlomiejbloniarz/add-set-snapshot-after-updates branch November 4, 2025 16:55
github-merge-queue bot pushed a commit to software-mansion/react-native-reanimated that referenced this pull request Dec 3, 2025
<!-- Thanks for submitting a pull request! We appreciate you spending
the time to work on these changes. Please follow the template so that
the reviewers can easily understand what the code changes affect. -->

## Summary
This PR brings back the Shared Element Transition feature to reanimated
(within a limited scope and behind a feature flag).

Current limitations:
- animations with native modals don't work on iOS (the modal is
displayed over the Shared Element). This can be fixed by plugging the
Shared Element into the Window, instead of the React's RootVIew.
- can't define custom progress (swipe back) transitions (it just isn't
implemented yet, it was easier to hard code)
- progress transitions animate less props than basic ones (for the same
reason as above)
- on iOS there are still some issues with header height (e.g. the `[SET]
Modals`) example
- there are some performance bottlenecks, that stem from transforms
being recalculated too eagerly (this requires some changes to how we
recognize whether to start a transition)
- we have to use a workaround for rnscreens to not keep a snapshot of
the transitioning view on the popped screen. Currently the
[fix](software-mansion/react-native-screens#3296)
is available in their nightly release.
- zIndex of exiting animations changes (they are brought to the front).
This differs from the current behaviour.
- sometimes on a fast refresh, the transition will run for elements that
are on the same screen. From our testing it happened when the navigator
was wrapped with a context provider, but we didn't investigate it
further. The problem was, that in this case the native view that
represents the screen actually changed, so the SET logic worked as it
should. But it definitely is not the expected outcome

## Test plan

<!-- Provide a minimal but complete code snippet that can be used to
test out this change along with instructions how to run it and a
description of the expected behavior. -->

---------

Co-authored-by: Krzysztof Piaskowy <krzysztof.piaskowy@swmansion.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants