Skip to main content
Version: 1.x

HeaderMotion.NavigationBridge

Re-provides a previously captured HeaderMotion context value in another subtree. Use together with HeaderMotion.Bridge.

Usage

<HeaderMotion.Bridge>
{(ctx) => (
<Stack.Screen
options={{
header: () => (
<HeaderMotion.NavigationBridge value={ctx}>
<MyHeader />
</HeaderMotion.NavigationBridge>
),
}}
/>
)}
</HeaderMotion.Bridge>

Inside MyHeader, all Header Motion hooks work normally:

function MyHeader() {
const { progress, progressThreshold } = useMotionProgress();
// ...
}

Props

PropTypeDescription
valueHeaderMotionBridgeValueThe context value captured by HeaderMotion.Bridge.
childrenReactNodeThe subtree that should have access to HeaderMotion context.