TrackedTextInput
Wraps TextInput in a InputContext and automatically tracks InputChangeEvent for it.
TrackedTextInput: (props: TextInputProps & {
id: string,
trackValue?: boolean,
}) => TextInput
Additional Props
type | default value | ||
---|---|---|---|
required | id | string | |
optional | trackValue | boolean | false |
Automatic Events
- InputChangeEvent when
onEndEditing
triggers.
Global Contexts
- InputValueContext with the changed value, if
trackValue
is set totrue
.
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.
See also