one
Version:
One is a new React Framework that makes Vite serve both native and web.
25 lines (24 loc) • 776 B
JavaScript
import { useIsomorphicLayoutEffect } from "@vxrn/use-isomorphic-layout-effect";
import { NAVIGATOR_CONFIG } from "../headless/children.native.js";
import { useNavigation } from "../router/useNavigation.native.js";
function Screen(param) {
var {
name,
options
} = param;
var navigation = useNavigation(name);
useIsomorphicLayoutEffect(function () {
if (options &&
// React Navigation will infinitely loop in some cases if an empty object is passed to setOptions.
// https://github.com/expo/router/issues/452
Object.keys(options).length) {
navigation.setOptions(options);
}
}, [navigation, options]);
return null;
}
Object.assign(Screen, {
[NAVIGATOR_CONFIG]: true
});
export { Screen };
//# sourceMappingURL=Screen.native.js.map