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
{{ message }}
Repository navigation
Commit c1978b3
Browse filesBrowse the repository at this point in the historyBrowse files
> Available since React Native Testing Library 14.1.0.
171
+
172
+
```tsx
173
+
fireEvent.layout: (
174
+
instance: TestInstance,
175
+
layout?:Partial<{ x: number; y: number; width: number; height: number }>,
176
+
) =>Promise<void>
177
+
```
178
+
179
+
Builds a layout event carrying the given `layout` rectangle and invokes the `layout` handler on the element or nearest eligible parent. Use it to simulate the layout engine measuring an element, e.g. to test components that adapt to a measured size.
180
+
181
+
The `layout` values are merged onto a zeroed rectangle (`{ x: 0, y: 0, width: 0, height: 0 }`), so pass only the fields your component reads.
Available since React Native Testing Library 14.1.0.
176
+
:::
177
+
178
+
```tsx
179
+
fireEvent.layout: (
180
+
instance: TestInstance,
181
+
layout?:Partial<{ x: number; y: number; width: number; height: number }>,
182
+
) =>Promise<void>
183
+
```
184
+
185
+
Builds a layout event carrying the given `layout` rectangle and invokes the `layout` handler on the element or nearest eligible parent. Use it to simulate the layout engine measuring an element, e.g. to test components that adapt to a measured size.
186
+
187
+
The `layout` values are merged onto a zeroed rectangle (`{ x: 0, y: 0, width: 0, height: 0 }`), so pass only the fields your component reads.
0 commit comments