UNPKG

823 BJavaScriptView Raw
1import Group from './Group';
2import Screen from './Screen';
3
4/**
5 * Higher order component to create a `Navigator` and `Screen` pair.
6 * Custom navigators should wrap the navigator component in `createNavigator` before exporting.
7 *
8 * @param Navigator The navigtor component to wrap.
9 * @returns Factory method to create a `Navigator` and `Screen` pair.
10 */
11export default function createNavigatorFactory(Navigator) {
12 return function () {
13 if (arguments[0] !== undefined) {
14 throw new Error("Creating a navigator doesn't take an argument. Maybe you are trying to use React Navigation 4 API? See https://reactnavigation.org/docs/hello-react-navigation for the latest API and guides.");
15 }
16
17 return {
18 Navigator,
19 Group,
20 Screen
21 };
22 };
23}
24//# sourceMappingURL=createNavigatorFactory.js.map
\No newline at end of file