Expo UI and Router for iOSExpo SDK 57 and later, iOS only
Modifiers

onGeometryChange

Calls the handler whenever the view's geometry changes, with its position and size. x and y are in the global coordinate space (relative to the window); all values are in points.

onGeometryChange(handler)

ParameterTypeDescription
handler(frame: { height: number, width: number, x: number, y: number }) => voidFunction called with the new frame.

Calls the handler whenever the view's geometry changes, with its position and size. x and y are in the global coordinate space (relative to the window); all values are in points.

Returns: ModifierConfig

See: Official SwiftUI documentation.

Works with

You can add onGeometryChange to any view. It changes what you see on 33 of the 39 components.

No visible effect

These components accept it, but you see no change.

ComponentWhy nothing happens
SpacerIn SDK 57, Spacer does not send modifier events to JavaScript, so the handler does not run.
DividerIn SDK 57, Divider does not send modifier events to JavaScript, so the handler does not run.
SliderIn SDK 57, Slider does not send modifier events to JavaScript, so the handler does not run.
MenuIn SDK 57, Menu does not send modifier events to JavaScript, so the handler does not run.
ContextMenuIn SDK 57, ContextMenu does not send modifier events to JavaScript, so the handler does not run.
AccessoryWidgetBackgroundIn SDK 57, AccessoryWidgetBackground does not send modifier events to JavaScript, so the handler does not run.

Sources

The original Expo docs for this page:

On this page