33import type {
44 NavigationState ,
55 NavigationDispatch ,
6- NavigationContainer ,
6+ NavigationNavigator ,
77 NavigationScreenProp ,
8+ NavigationNavigatorProps ,
89} from '@react-navigation/core' ;
910
1011import * as React from 'react' ;
@@ -22,19 +23,29 @@ type RequiredProps<State: NavigationState> = {
2223type InjectedProps < State : NavigationState > = {
2324 navigation : NavigationScreenProp < State > ,
2425} ;
25- function createReduxContainer < State : NavigationState , Props : RequiredProps < State > > (
26- Navigator : NavigationContainer <
26+ function createReduxContainer <
27+ State : NavigationState ,
28+ Options : { } ,
29+ NavigatorProps : NavigationNavigatorProps < Options , State > ,
30+ NavigatorType: NavigationNavigator<
2731 State ,
28- * ,
29- $Diff < Props , RequiredProps < State >> ,
32+ Options ,
33+ NavigatorProps ,
3034 > ,
35+ ContainerProps: {
36+ ...$Diff < NavigatorProps , InjectedProps < State >> ,
37+ ...$Exact < RequiredProps < State >> ,
38+ } ,
39+ > (
40+ Navigator : NavigatorType ,
3141 key ?: string = "root ",
32- ) : React . ComponentType < Props > {
42+ ) : React . ComponentType < ContainerProps > {
3343 const didUpdateCallback = createDidUpdateCallback ( key ) ;
3444 const propConstructor = createNavigationPropConstructor ( key ) ;
3545
36- class NavigatorReduxWrapper extends React . PureComponent < Props > {
46+ class NavigatorReduxWrapper extends React . PureComponent < ContainerProps > {
3747
48+ static router = Navigator . router ;
3849 currentNavProp : ?NavigationScreenProp < State > ;
3950
4051 componentDidMount ( ) {
0 commit comments