import { Platform } from 'react-native'; import { DxaReactNative } from '../DxaReactNative'; import type { ScreenChangePayload } from './ScreenChangePayload'; export function reportScreenChangeOnNative( screenChangePayload: ScreenChangePayload ): void { if (Platform.OS === 'android' || Platform.OS === 'ios') { logScreenChange(screenChangePayload); DxaReactNative.reportScreenChangeOnNative(screenChangePayload); } } function logScreenChange(screenChangePayload: ScreenChangePayload) { console.debug( 'Sending screen change to native:', JSON.stringify(screenChangePayload) ); }