TrackedTouchableWithoutFeedback
Wraps TouchableWithoutFeedback in a PressableContext and automatically tracks PressEvent for it.
TrackedTouchableWithoutFeedback: (props: TouchableWithoutFeedbackProps & {
id?: string,
}) => TouchableWithoutFeedback
Additional Props
type | default value | ||
---|---|---|---|
optional | id | string | inferred from children |
info
In development mode, TrackedTouchableWithoutFeedback will log an error to the console when failing to infer an identifier from children
.
Automatic Events
- PressEvent when
onPress
triggers.
Usage examples
A regular TouchableWithoutFeedback
import { TrackedTouchableWithoutFeedback } from '@objectiv/tracker-react-native';
<TrackedTouchableWithoutFeedback
onPress={onPressFunction}
>
<Text>Press me!</Text>
</TrackedTouchableWithoutFeedback>
Non parseable children
import { TrackedTouchableWithoutFeedback } from '@objectiv/tracker-react-native';
<TrackedTouchableWithoutFeedback
onPress={onPressFunction}
id="thumb-down"
>
<Text>👎</Text>
</TrackedTouchableWithoutFeedback>
Custom identifier
import { TrackedTouchableWithoutFeedback } from '@objectiv/tracker-react-native';
<TrackedTouchableWithoutFeedback
onPress={onPressFunction}
id="custom-analytics-id"
>
<Text>Press me!</Text>
</TrackedTouchableWithoutFeedback>
Did you know ?
TrackedTouchableWithoutFeedback
internally uses PressableContextWrapper.