InputContextWrapper
Wraps its children in a InputContext.
Children can be a ReactNode or a Render Props function receiving TrackingContext.
InputContextWrapper: (props: {
children: ReactNode | ((parameters: TrackingContext) => ReactNode),
id: string
}) => ReactElement
Parameters
type | ||
---|---|---|
required | children | ReactNode | ((parameters: TrackingContext) => void) |
required | id | string |
Returns
ReactElement
Usage example
Enrich Locations
import { InputContextWrapper } from '@objectiv/tracker-react-native';
<InputContextWrapper id={'email'}>
<TextInput keyboardType={'email-address'} />
</InputContextWrapper>
Tracking via Render Props
import {
InputContextWrapper,
trackInputChangeEvent
} from '@objectiv/tracker-react-native';
<InputContextWrapper id={'search'}>
{(trackingContext) => (
<TextInput
onBlur={() => trackInputChangeEvent(trackingContext)}
/>
)}
</InputContextWrapper>
info
The above is just an example to illustrate the Render Props functionality.
Check out our Tracked Components for ready-to-use Components.
Did you know ?
InputContextWrapper
internally uses LocationContextWrapper.