Share typed data across steps using the `shared` prop
mainYou can pass a shared object to BottomSheetStepper. This object is automatically injected into every step function via StepComponentProps. The type of shared is inferred from the object you provide, ensuring type safety within your step components without manual casting.
// `user` is your own data — its type flows into every step, no annotation needed
<BottomSheetStepper
ref={stepperRef}
shared={{ user }}
initialStep={0}
steps={[
({ shared, onNextPress }) => (
<AccountStep user={shared.user} onNext={onNextPress} />
),
({ shared, onEnd }) => (
<ConfirmStep user={shared.user} onDone={onEnd} />
),
]}
/>;