Appearance
LoggingPress
요소가 사용자 액션에 의해 눌렸을 때 눌렸다고 로그를 남기는 컴포넌트예요. 예를 들어, 버튼을 눌러 구매를 하는 로그를 남기고 싶을 때 사용해요.
시그니처
typescript
LoggingPress: import("react").ForwardRefExoticComponent<LoggingPressProps & import("react").RefAttributes<unknown>>
예제
클릭 가능한 요소의 클릭 이벤트를 자동으로 수집하는 예시
tsx
import { Analytics } from '@apps-in-toss/framework';
import { Button } from 'react-native';
// 클릭 가능한 요소의 클릭 이벤트를 자동으로 수집해요.
function TrackElements() {
return (
<Analytics.Press>
<Button label="Press Me" />
</Analytics.Press>
);
}