Overview
Version 3.4 is fully backward compatible with 3.3. All deprecated APIs continue to work, but this guide helps you migrate to the new patterns for better code clarity and future compatibility. Key changes:- Boundary components with
idprop replacesharedBoundTag - Slot-based return format for animations
- Auto snap points with
snapPoints: ["auto"] - New gesture and animation options
- Built-in
navigationMaskEnabledreplacesTransition.MaskedView
Step 1: Update Boundary Components
From sharedBoundTag
ThesharedBoundTag prop on Transition.View and Transition.Pressable is deprecated.
Before (v3.3):
- Clearer intent:
Boundary.Viewexplicitly marks shared elements - Better composability: Separate boundary from content
- Type-safe: Dedicated components with props validation
Step 2: Migrate Interpolator Return Format
The flatcontentStyle/backdropStyle format is deprecated. Use the new slot-based format.
Before (v3.3)
After (v3.4)
- Rename
contentStyle→content: { style: ... } - Rename
backdropStyle→backdrop: { style: ... } - Nest styles under
stylekey
Step 3: Update Navigation Masking
ReplaceTransition.MaskedView with the navigationMaskEnabled prop.
Before (v3.3)
After (v3.4)
- Simpler API: No wrapper component needed
- Built-in optimization: Native-level masking
- Cleaner code: One prop instead of wrapper
Step 4: Auto Snap Points
If you have dynamic content sizing, usesnapPoints: ["auto"].
Before (v3.3)
After (v3.4)
"auto"measures content intrinsic height- Access measured height via
layouts.content.height - Perfect for dynamic content like forms, lists
Step 5: Update Scroll Gesture Behavior
Replace theexpandViaScrollView boolean with explicit behavior.
Before (v3.3)
After (v3.4)
"expand-and-collapse": Both expand and collapse work at scroll boundary (replacestrue)"collapse-only": Only collapse works; expand requires dead space (replacesfalse)
Step 6: New Gesture Options
v3.4 adds precise velocity control. Consider using these if you experienced velocity issues.Step 7: Ancestor Targeting in Hooks
If using custom gesture hooks, update to new ancestor targeting syntax.Before (v3.3)
After (v3.4)
useScreenAnimation().
Step 8: Surface Slots (Optional)
If you need custom surface layers, use the new surface slot.Step 9: Boundary Component Factory
If wrapping custom components, use the new factory.Migration Checklist
Work through this checklist to ensure complete migration:- Replace
sharedBoundTagwithTransition.Boundary.View/Pressableandidprop - Convert flat
contentStyle/backdropStyleto slot formatcontent: { style }/backdrop: { style } - Replace
Transition.MaskedViewwrapper withnavigationMaskEnabledprop - Update dynamic snap points to use
"auto"where appropriate - Change
expandViaScrollViewboolean tosheetScrollGestureBehaviorstring - Add new gesture velocity options if needed (
gestureReleaseVelocityScale,gestureReleaseVelocityMax) - Update gesture hooks to use ancestor targeting (if applicable)
- Test all animations on both iOS and Android
- Verify shared elements work with new boundary components
- Check snap point behavior with scroll coordination
- Profile performance on low-end devices
Common Patterns
Sheet with Auto-Sizing
Shared Element with Bounds
Masked Animation
Testing After Migration
After migrating, test:- Animations: All transitions work smoothly
- Gestures: Swipe/drag works as expected
- Shared elements: Bounds animate correctly
- Snap points: Sheets snap to correct positions
- Scroll coordination: ScrollView + sheet gestures don’t conflict
- Platforms: Test on both iOS and Android
- Devices: Test on low-end devices for performance
Troubleshooting Migration
Animations not running
Ensure:screenStyleInterpolatoris set- Interpolator returns proper slot format
- Boundaries are mounted and visible
Shared elements not animating
Check:- Boundary component IDs match (source and destination)
- Both boundaries are rendered
- Interpolator queries bounds with correct ID
Scroll and gesture conflict
Verify:sheetScrollGestureBehavioris setTransition.ScrollViewis used (or manual coordination)- ScrollView is at boundary when testing
Getting Help
If you encounter issues during migration:- Check this guide’s troubleshooting section
- Review the whats-new guide
- See specific concept guides for detailed explanations
- Check the GitHub repository for examples
Summary
v3.4 migration is straightforward:- Update boundary components
- Convert interpolator return format
- Enable navigation masking
- Use auto snap points for dynamic content
- Update scroll gesture behavior
Next Steps
- Review concepts for detailed explanations
- Check components reference
- Explore guides for specific use cases
