TrackedTouchableWithoutFeedback

Wraps TouchableWithoutFeedback in a PressableContext and automatically tracks PressEvent for it.

TrackedTouchableWithoutFeedback: (props: TouchableWithoutFeedbackProps & {
id?: string,
}) => TouchableWithoutFeedback

Additional Props

typedefault value
optionalidstringinferred from children
info

In development mode, TrackedTouchableWithoutFeedback will log an error to the console when failing to infer an identifier from children.

Automatic Events

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.