Home > @uniformdev/context-react

context-react package

Functions

FunctionDescription
Personalize(props)
Test(props)
Track({ behavior, children, tagName, threshold, disableVisibilityTrigger, ...rest })<p>Tracks visitor behavior by adding enrichment score when they view content wrapped in this component. When the Track component is sufficiently in the viewport, it will trigger the enrichment values specified in <code>behavior</code> to the current visitor. If the browser does not support IntersectionObserver, the behavior will be triggered immediately on page load instead.</p><p>NOTE: this component necessarily renders a wrapping tag to attach the IntersectionObserver to; this can result in DOM changes when personalization is added. If that's undesirable use TrackFragment instead which tracks only on page load, but does not render a wrapping tag.</p>
TrackFragment({ behavior, children })<p>Tracks visitor behavior by adding enrichment score when they are shown a route with this component on it.</p><p>NOTE: if you wish to track on the visitor seeing the content in the browser viewport instead, use Track instead of TrackFragment.</p>
useQuirks(options)Provides reactive access to the Uniform Context's current visitor quirks values This can be used when you want to read current quirk values directly.
useScores()Provides reactive access to the Uniform Context's current visitor scores values. This can be used when you want to read current score values directly.
useUniformContext(options)<p>Gets the current Uniform Context object (must be within a UniformContext component ancestor)</p><p>IMPORTANT: The Context object's scores and quirks (i.e. context.scores) are NOT reactive when fetched with this hook. If you need reactive scores or quirks use <code>useScores</code> and <code>useQuirks</code> instead.</p>
useUniformContext(options)

Interfaces

InterfaceDescription
TestComponentProps
UniformContextProps

Variables

VariableDescription
UniformContextRegisters Uniform Context with a React app (as a React Context!). Children of this component may use the Context via hooks, such as useScores and useUniformContext.

Type Aliases

Type AliasDescription
PersonalizeComponentProps
PersonalizedVariationComponent
PersonalizeWrapperComponent
TrackFragmentProps
TrackProps
TVariation
VariantOutputType