A wrapper View with interaction tracking attached
"Component tracking" refers to tracking Contentful entry components (content entries), not React Native UI components. Must be used within an OptimizationProvider. Works with or without a OptimizationScrollProvider — when outside a OptimizationScrollProvider, screen dimensions are used instead.
By default the component locks to the first variant it receives to prevent UI
flashing. Set liveUpdates to true or open the preview panel to enable
real-time variant switching.
<OptimizationScrollProvider>
<Personalization baselineEntry={baselineEntry}>
{(resolvedEntry) => (
<HeroComponent
title={resolvedEntry.fields.title}
image={resolvedEntry.fields.image}
/>
)}
</Personalization>
</OptimizationScrollProvider>
<Personalization baselineEntry={entry} trackTaps>
{(resolvedEntry) => (
<Pressable onPress={() => navigate(resolvedEntry)}>
<Card title={resolvedEntry.fields.title} />
</Pressable>
)}
</Personalization>
Tracks views and taps of personalized Contentful entry components and resolves variants based on the user's profile and active personalizations.