diff --git a/types/react-native-navigation/index.d.ts b/types/react-native-navigation/index.d.ts index 86b94bff44..88bb8fe29e 100644 --- a/types/react-native-navigation/index.d.ts +++ b/types/react-native-navigation/index.d.ts @@ -7,7 +7,7 @@ import * as React from 'react'; export namespace Navigation { - function registerComponent(screenID: string, generator: () => React.ComponentType, store?: any, provider?: any): void; + function registerComponent(screenID: string, generator: () => React.ComponentType, store?: any, provider?: any, options?: any): void; function startTabBasedApp(params: TabBasedApp): void; function startSingleScreenApp(params: SingleScreenApp): void; function showModal(params: ModalScreen): void; diff --git a/types/react-native-navigation/react-native-navigation-tests.tsx b/types/react-native-navigation/react-native-navigation-tests.tsx index 004673e10a..371465b1c9 100644 --- a/types/react-native-navigation/react-native-navigation-tests.tsx +++ b/types/react-native-navigation/react-native-navigation-tests.tsx @@ -63,7 +63,23 @@ const Drawer = (props: NavigationComponentProps) => { ); }; -Navigation.registerComponent('example.Screen1', () => Screen1); +interface TestProviderProps { + test: string; +} + +class TestProvider extends React.Component { + getChildContext() { + return { + test: this.props.test + }; + } + + render() { + return this.props.children; + } +} + +Navigation.registerComponent('example.Screen1', () => Screen1, {}, TestProvider, {test: "test"}); Navigation.registerComponent('example.Screen2', () => Screen2); Navigation.registerComponent('example.Drawer', () => Drawer);