Expo UI and Router for iOS
Modifiers

defaultScrollAnchorForRole

Sets the default anchor point for a scroll view for a specific role. Pass null to opt out of a specific role while keeping anchors for other roles.

defaultScrollAnchorForRole(anchor, role)

iOS 18+
ParameterTypeDescription
anchorUnitPointValue | nullThe anchor point, or null to opt out of this role.
role'initialOffset' | 'sizeChanges' | 'alignment'The scroll anchor role: 'initialOffset', 'sizeChanges', or 'alignment'.

Sets the default anchor point for a scroll view for a specific role. Pass null to opt out of a specific role while keeping anchors for other roles.

Returns: ModifierConfig

See: Official SwiftUI documentation.

Works with

Sources

The original Expo docs for this page:

On this page