TrackedTextInput

Wraps TextInput in a InputContext and automatically tracks InputChangeEvent for it.

TrackedTextInput: (props: TextInputProps & {
id: string,
trackValue?: boolean,
}) => TextInput

Additional Props

typedefault value
requiredidstring
optionaltrackValuebooleanfalse

Automatic Events

Global Contexts

Usage example

import { TrackedTextInput } from '@objectiv/tracker-react-native';

<TrackedTextInput
id="input-id"
onChangeText={onChangeText}
value={text}
/>

To track also the changed value and attach it to Event's Global Contexts as InputValueContext:

import { TrackedTextInput } from '@objectiv/tracker-react-native';

<TrackedTextInput
id="input-id"
onChangeText={onChangeText}
value={text}
trackValue={true}
/>

Did you know ?

TrackedTextInput internally uses InputContextWrapper.