UNPKG

one

Version:

One is a React framework for web, iOS, and Android apps.

1 lines • 1.09 kB
{"version":3,"file":"Screen.js","names":[],"sources":["esm/views/Screen.js"],"sourcesContent":["import { useIsomorphicLayoutEffect } from \"@vxrn/use-isomorphic-layout-effect\";\nimport { NAVIGATOR_CONFIG } from \"../headless/children\";\nimport { useNavigation } from \"../router/useNavigation\";\nfunction Screen({\n name,\n options\n}) {\n const navigation = useNavigation(name);\n useIsomorphicLayoutEffect(() => {\n if (options && // React Navigation will infinitely loop in some cases if an empty object is passed to setOptions.\n // https://github.com/expo/router/issues/452\n Object.keys(options).length) {\n navigation.setOptions(options);\n }\n }, [navigation, options]);\n return null;\n}\nObject.assign(Screen, { [NAVIGATOR_CONFIG]: true });\nexport {\n Screen\n};\n//# sourceMappingURL=Screen.js.map\n"],"mappings":";;;;;AAGA,SAAS,OAAO,EACd,MACA,WACC;CACD,MAAM,aAAa,cAAc,IAAI;CACrC,gCAAgC;EAC9B,IAAI,WAEJ,OAAO,KAAK,OAAO,CAAC,CAAC,QAAQ;GAC3B,WAAW,WAAW,OAAO;EAC/B;CACF,GAAG,CAAC,YAAY,OAAO,CAAC;CACxB,OAAO;AACT;AACA,OAAO,OAAO,QAAQ,GAAG,mBAAmB,KAAK,CAAC"}