Skip to content

Commit d292bef

Browse files
committed
wip use React$ElementRef
1 parent b53278b commit d292bef

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/ZulipMobile.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ export default (): React$Node => (
3232
<AppContainer
3333
// `static navigationOptions` and `static router` not
3434
// being handled properly
35-
// $FlowFixMe
3635
ref={NavigationService.appContainerRef}
3736
/>
3837
</InitialNavigationDispatcher>

src/nav/NavigationService.js

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,13 @@ import type {
77
NavigationContainerProps,
88
} from 'react-navigation';
99

10+
/* prettier-ignore */
1011
const appContainerRef = React.createRef<
11-
NavigationContainer<NavigationState, { ... }, NavigationContainerProps<{ ... }, NavigationState>>,
12+
React$ElementRef<
13+
NavigationContainer<
14+
NavigationState,
15+
{ ... },
16+
NavigationContainerProps<{ ... }, NavigationState>>>
1217
>();
1318

1419
const getState = (): NavigationState => {
@@ -25,11 +30,7 @@ const dispatch = (navigationAction: NavigationAction): boolean => {
2530
if (appContainerRef.current === null) {
2631
throw new Error('Tried to use NavigationService before appContainerRef was set.');
2732
}
28-
return (
29-
appContainerRef.current
30-
// $FlowFixMe - how to tell Flow about this method?
31-
.dispatch(navigationAction)
32-
);
33+
return appContainerRef.current.dispatch(navigationAction);
3334
};
3435

3536
export default {

0 commit comments

Comments
 (0)