import { RootTagContext } from 'react-native';import NativeAnalytics from 'native-analytics';import NativeNavigation from 'native-navigation';function ScreenA() { const rootTag = useContext(RootTagContext); const updateTitle = (title) => { NativeNavigation.setTitle(rootTag, title);}; const handleOneEvent = () => { NativeAnalytics.logEvent(rootTag, 'one_event'); }; // ...}class ScreenB extends React.Component { static contextType: typeof RootTagContext = RootTagContext; updateTitle(title) { NativeNavigation.setTitle(this.context, title); } handleOneEvent() { NativeAnalytics.logEvent(this.context, 'one_event'); } // ...}