Skipped 1 file(s) >100MB (GitHub limit): source/__polyfill/04xxx/module_4759.js (118.4 MB)
29 lines
1,017 B
JavaScript
29 lines
1,017 B
JavaScript
// Module ID: 1558
|
|
// Function ID: 1559
|
|
// Dependencies: [32, 19, 1492, 1518]
|
|
// Exports: useRegisterNavigator
|
|
|
|
// Module 1558
|
|
import _slicedToArray from "module_32" /* 32 */;
|
|
import noop from "module_19" /* 19 */;
|
|
|
|
const require = arg1;
|
|
|
|
export const useRegisterNavigator = function useRegisterNavigator() {
|
|
const first = _slicedToArray(noop.useState(() => first(context[2]).nanoid()), 1)[0];
|
|
context = noop.useContext(first(context[3]).SingleNavigatorContext);
|
|
if (undefined === context) {
|
|
const _Error = Error;
|
|
const error = new Error("Couldn't register the navigator. Have you wrapped your app with 'NavigationContainer'?\n\nThis can also happen if there are multiple copies of '@react-navigation' packages installed.");
|
|
throw error;
|
|
} else {
|
|
const items = [context, first];
|
|
const effect = obj.useEffect(() => {
|
|
const unregister = context.unregister;
|
|
context.register(unregister);
|
|
return () => unregister(first);
|
|
}, items);
|
|
return first;
|
|
}
|
|
obj = noop;
|
|
};
|