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
|`displayName`|`string`| Auto-generated | Component name shown in React DevTools. |
26
-
|`isComponentAnimated`|`boolean`|`false`| Set to `true` when the component is already animated (skips `Animated.createAnimatedComponent`). |
27
-
|`contentContainerMode`|`'children' \| 'renderScrollComponent'`|`'renderScrollComponent'`| How Header Motion injects content offsetting. Use `'children'` for ScrollView-like, `'renderScrollComponent'` for FlatList-like. |
|`displayName`|`string`| Auto-generated | Component name shown in React DevTools. |
28
+
|`isComponentAnimated`|`boolean`|`false`| Set to `true` when the component is already animated (skips `Animated.createAnimatedComponent`). |
29
+
|`contentContainerMode`|`'children' \| 'renderScrollComponent'`|`'renderScrollComponent'`| How Header Motion injects content offsetting. Use `'children'` for ScrollView-like, `'renderScrollComponent'` for FlatList-like. |
30
+
|`managedRefTarget`|`'outer' \| 'inner'`|`'outer'`| Which ref Header Motion uses for imperative sync. Only applies in `renderScrollComponent` mode. Use `'inner'` when the wrapped list's outer ref is not the actual scroll view. |
Use `managedRefTarget: 'inner'` when the wrapped component exposes a controller ref on the outside but owns the actual native scroll view internally. FlashList and LegendList both need this. React Native `FlatList` does not, so the default `'outer'` behavior remains correct there.
75
+
57
76
The returned component accepts all the original component's props plus Header Motion-specific props (`scrollId`, `headerOffsetStrategy`, `ensureScrollableContentMinHeight`, `animatedRef`).
Copy file name to clipboardExpand all lines: docs/docs/guides/custom-scrollables.md
+39-9Lines changed: 39 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,15 +7,21 @@ title: Custom scrollables
7
7
8
8
Header Motion ships with `HeaderMotion.ScrollView` and `HeaderMotion.FlatList`, but you can integrate **any** scrollable component via the `createHeaderMotionScrollable()` factory. The resulting component works just like the built-in ones — it accepts all the original props plus Header Motion-specific ones like `scrollId` and `headerOffsetStrategy`.
9
9
10
+
For popular third-party lists, the library also exports `ScrollablePresets` with the recommended option combinations.
Use `managedRefTarget: 'inner'` when a third-party list exposes a controller ref on the outside but keeps the real native scroll view one layer deeper. FlashList and LegendList both fall into that category. React Native `FlatList` does not, so it should keep the default `'outer'`.
|`displayName`|`string`| Auto-derived from the component name | Sets the React `displayName` for dev tools. |
54
83
|`isComponentAnimated`|`boolean`|`false`| When `true`, the factory skips `Animated.createAnimatedComponent()`. Set this when the component is already animated. |
55
84
|`contentContainerMode`|`'children' \| 'renderScrollComponent'`|`'renderScrollComponent'`|`'children'` wraps children in an inner `Animated.View` (ScrollView-like). `'renderScrollComponent'` injects a custom scroll component that wraps the content (FlatList-like). |
85
+
|`managedRefTarget`|`'outer' \| 'inner'`|`'outer'`| Controls which ref Header Motion uses for imperative sync. Only applies in `renderScrollComponent` mode. Use `'inner'` for list abstractions like FlashList and LegendList. |
Copy file name to clipboardExpand all lines: docs/docs/guides/default-scrollables.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -66,7 +66,7 @@ You can also pass standard scroll event handlers like `onScroll`, `onScrollBegin
66
66
67
67
## Custom scrollables
68
68
69
-
For third-party scrollable components like [FlashList](https://shopify.github.io/flash-list/) or [LegendList](https://github.com/LegendApp/legend-list), use the `createHeaderMotionScrollable()` factory. For more information, check the [Custom scrollables](./custom-scrollables) guide.
69
+
For third-party scrollable components like [FlashList](https://shopify.github.io/flash-list/) or [LegendList](https://github.com/LegendApp/legend-list), use the `createHeaderMotionScrollable()` factory. For those two common integrations, you can also start from the exported `ScrollablePresets`. For more information, check the [Custom scrollables](./custom-scrollables) guide.
70
70
71
71
For even more control, you can manage the scroll integration yourself using `HeaderMotion.ScrollManager` or the `useScrollManager()` hook. See [Using ScrollManager](./using-scroll-manager) for details.
Copy file name to clipboardExpand all lines: docs/docs/other/faq.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ Header panning is built on Gesture Handler's pan gesture. Even if you don't use
22
22
23
23
## Can I use this with FlashList / LegendList / other custom scrollables?
24
24
25
-
Yes. Use `createHeaderMotionScrollable()` to wrap any scrollable component. See the [Custom scrollables](../guides/custom-scrollables) guide.
25
+
Yes. Use `createHeaderMotionScrollable()` to wrap any scrollable component. For FlashList and LegendList, you can also use the built-in `ScrollablePresets` export so the recommended factory options are already filled in. See the [Custom scrollables](../guides/custom-scrollables) guide.
0 commit comments