@react-navigation/core 6.4.3 → 6.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (351) hide show
  1. package/lib/commonjs/BaseNavigationContainer.js +17 -69
  2. package/lib/commonjs/BaseNavigationContainer.js.map +1 -1
  3. package/lib/commonjs/CurrentRenderContext.js +0 -4
  4. package/lib/commonjs/CurrentRenderContext.js.map +1 -1
  5. package/lib/commonjs/EnsureSingleNavigator.js +1 -12
  6. package/lib/commonjs/EnsureSingleNavigator.js.map +1 -1
  7. package/lib/commonjs/Group.js +0 -1
  8. package/lib/commonjs/Group.js.map +1 -1
  9. package/lib/commonjs/NavigationBuilderContext.js +0 -4
  10. package/lib/commonjs/NavigationBuilderContext.js.map +1 -1
  11. package/lib/commonjs/NavigationContainerRefContext.js +0 -4
  12. package/lib/commonjs/NavigationContainerRefContext.js.map +1 -1
  13. package/lib/commonjs/NavigationContext.js +0 -4
  14. package/lib/commonjs/NavigationContext.js.map +1 -1
  15. package/lib/commonjs/NavigationHelpersContext.js +0 -4
  16. package/lib/commonjs/NavigationHelpersContext.js.map +1 -1
  17. package/lib/commonjs/NavigationRouteContext.js +0 -4
  18. package/lib/commonjs/NavigationRouteContext.js.map +1 -1
  19. package/lib/commonjs/NavigationStateContext.js +0 -12
  20. package/lib/commonjs/NavigationStateContext.js.map +1 -1
  21. package/lib/commonjs/PreventRemoveContext.js +0 -4
  22. package/lib/commonjs/PreventRemoveContext.js.map +1 -1
  23. package/lib/commonjs/PreventRemoveProvider.js +3 -21
  24. package/lib/commonjs/PreventRemoveProvider.js.map +1 -1
  25. package/lib/commonjs/SceneView.js +8 -13
  26. package/lib/commonjs/SceneView.js.map +1 -1
  27. package/lib/commonjs/Screen.js +0 -1
  28. package/lib/commonjs/Screen.js.map +1 -1
  29. package/lib/commonjs/StaticContainer.js +0 -10
  30. package/lib/commonjs/StaticContainer.js.map +1 -1
  31. package/lib/commonjs/UnhandledActionContext.js +0 -4
  32. package/lib/commonjs/UnhandledActionContext.js.map +1 -1
  33. package/lib/commonjs/checkDuplicateRouteNames.js +0 -5
  34. package/lib/commonjs/checkDuplicateRouteNames.js.map +1 -1
  35. package/lib/commonjs/checkSerializable.js +0 -9
  36. package/lib/commonjs/checkSerializable.js.map +1 -1
  37. package/lib/commonjs/createNavigationContainerRef.js +0 -13
  38. package/lib/commonjs/createNavigationContainerRef.js.map +1 -1
  39. package/lib/commonjs/createNavigatorFactory.js +0 -5
  40. package/lib/commonjs/createNavigatorFactory.js.map +1 -1
  41. package/lib/commonjs/findFocusedRoute.js +5 -10
  42. package/lib/commonjs/findFocusedRoute.js.map +1 -1
  43. package/lib/commonjs/fromEntries.js +0 -3
  44. package/lib/commonjs/fromEntries.js.map +1 -1
  45. package/lib/commonjs/getActionFromState.js +11 -22
  46. package/lib/commonjs/getActionFromState.js.map +1 -1
  47. package/lib/commonjs/getFocusedRouteNameFromRoute.js +7 -8
  48. package/lib/commonjs/getFocusedRouteNameFromRoute.js.map +1 -1
  49. package/lib/commonjs/getPathFromState.js +25 -55
  50. package/lib/commonjs/getPathFromState.js.map +1 -1
  51. package/lib/commonjs/getStateFromPath.js +48 -105
  52. package/lib/commonjs/getStateFromPath.js.map +1 -1
  53. package/lib/commonjs/index.js +0 -30
  54. package/lib/commonjs/index.js.map +1 -1
  55. package/lib/commonjs/isArrayEqual.js +0 -3
  56. package/lib/commonjs/isArrayEqual.js.map +1 -1
  57. package/lib/commonjs/isRecordEqual.js +0 -4
  58. package/lib/commonjs/isRecordEqual.js.map +1 -1
  59. package/lib/commonjs/types.js +3 -5
  60. package/lib/commonjs/types.js.map +1 -1
  61. package/lib/commonjs/useChildListeners.js +0 -5
  62. package/lib/commonjs/useChildListeners.js.map +1 -1
  63. package/lib/commonjs/useComponent.js +3 -9
  64. package/lib/commonjs/useComponent.js.map +1 -1
  65. package/lib/commonjs/useCurrentRender.js +0 -7
  66. package/lib/commonjs/useCurrentRender.js.map +1 -1
  67. package/lib/commonjs/useDescriptors.js +11 -21
  68. package/lib/commonjs/useDescriptors.js.map +1 -1
  69. package/lib/commonjs/useEventEmitter.js +2 -24
  70. package/lib/commonjs/useEventEmitter.js.map +1 -1
  71. package/lib/commonjs/useFocusEffect.js +2 -20
  72. package/lib/commonjs/useFocusEffect.js.map +1 -1
  73. package/lib/commonjs/useFocusEvents.js +9 -15
  74. package/lib/commonjs/useFocusEvents.js.map +1 -1
  75. package/lib/commonjs/useFocusedListenersChildrenAdapter.js +0 -8
  76. package/lib/commonjs/useFocusedListenersChildrenAdapter.js.map +1 -1
  77. package/lib/commonjs/useIsFocused.js +0 -8
  78. package/lib/commonjs/useIsFocused.js.map +1 -1
  79. package/lib/commonjs/useKeyedChildListeners.js +0 -4
  80. package/lib/commonjs/useKeyedChildListeners.js.map +1 -1
  81. package/lib/commonjs/useNavigation.js +3 -11
  82. package/lib/commonjs/useNavigation.js.map +1 -1
  83. package/lib/commonjs/useNavigationBuilder.js +34 -91
  84. package/lib/commonjs/useNavigationBuilder.js.map +1 -1
  85. package/lib/commonjs/useNavigationCache.js +18 -30
  86. package/lib/commonjs/useNavigationCache.js.map +1 -1
  87. package/lib/commonjs/useNavigationContainerRef.js +0 -8
  88. package/lib/commonjs/useNavigationContainerRef.js.map +1 -1
  89. package/lib/commonjs/useNavigationHelpers.js +4 -18
  90. package/lib/commonjs/useNavigationHelpers.js.map +1 -1
  91. package/lib/commonjs/useNavigationState.js +5 -9
  92. package/lib/commonjs/useNavigationState.js.map +1 -1
  93. package/lib/commonjs/useOnAction.js +8 -25
  94. package/lib/commonjs/useOnAction.js.map +1 -1
  95. package/lib/commonjs/useOnGetState.js +6 -16
  96. package/lib/commonjs/useOnGetState.js.map +1 -1
  97. package/lib/commonjs/useOnPreventRemove.js +9 -24
  98. package/lib/commonjs/useOnPreventRemove.js.map +1 -1
  99. package/lib/commonjs/useOnRouteFocus.js +0 -8
  100. package/lib/commonjs/useOnRouteFocus.js.map +1 -1
  101. package/lib/commonjs/useOptionsGetters.js +5 -24
  102. package/lib/commonjs/useOptionsGetters.js.map +1 -1
  103. package/lib/commonjs/usePreventRemove.js +0 -11
  104. package/lib/commonjs/usePreventRemove.js.map +1 -1
  105. package/lib/commonjs/usePreventRemoveContext.js +0 -8
  106. package/lib/commonjs/usePreventRemoveContext.js.map +1 -1
  107. package/lib/commonjs/useRegisterNavigator.js +0 -8
  108. package/lib/commonjs/useRegisterNavigator.js.map +1 -1
  109. package/lib/commonjs/useRoute.js +0 -8
  110. package/lib/commonjs/useRoute.js.map +1 -1
  111. package/lib/commonjs/useRouteCache.js +1 -10
  112. package/lib/commonjs/useRouteCache.js.map +1 -1
  113. package/lib/commonjs/useScheduleUpdate.js +1 -8
  114. package/lib/commonjs/useScheduleUpdate.js.map +1 -1
  115. package/lib/commonjs/useSyncState.js +9 -17
  116. package/lib/commonjs/useSyncState.js.map +1 -1
  117. package/lib/commonjs/validatePathConfig.js +0 -7
  118. package/lib/commonjs/validatePathConfig.js.map +1 -1
  119. package/lib/module/BaseNavigationContainer.js +17 -46
  120. package/lib/module/BaseNavigationContainer.js.map +1 -1
  121. package/lib/module/CurrentRenderContext.js +1 -1
  122. package/lib/module/CurrentRenderContext.js.map +1 -1
  123. package/lib/module/EnsureSingleNavigator.js +1 -7
  124. package/lib/module/EnsureSingleNavigator.js.map +1 -1
  125. package/lib/module/Group.js.map +1 -1
  126. package/lib/module/NavigationBuilderContext.js +0 -1
  127. package/lib/module/NavigationBuilderContext.js.map +1 -1
  128. package/lib/module/NavigationContainerRefContext.js +0 -1
  129. package/lib/module/NavigationContainerRefContext.js.map +1 -1
  130. package/lib/module/NavigationContext.js +0 -1
  131. package/lib/module/NavigationContext.js.map +1 -1
  132. package/lib/module/NavigationHelpersContext.js +0 -1
  133. package/lib/module/NavigationHelpersContext.js.map +1 -1
  134. package/lib/module/NavigationRouteContext.js +1 -1
  135. package/lib/module/NavigationRouteContext.js.map +1 -1
  136. package/lib/module/NavigationStateContext.js +0 -6
  137. package/lib/module/NavigationStateContext.js.map +1 -1
  138. package/lib/module/PreventRemoveContext.js +1 -0
  139. package/lib/module/PreventRemoveContext.js.map +1 -1
  140. package/lib/module/PreventRemoveProvider.js +3 -12
  141. package/lib/module/PreventRemoveProvider.js.map +1 -1
  142. package/lib/module/SceneView.js +8 -5
  143. package/lib/module/SceneView.js.map +1 -1
  144. package/lib/module/Screen.js.map +1 -1
  145. package/lib/module/StaticContainer.js +1 -6
  146. package/lib/module/StaticContainer.js.map +1 -1
  147. package/lib/module/UnhandledActionContext.js.map +1 -1
  148. package/lib/module/checkDuplicateRouteNames.js +0 -4
  149. package/lib/module/checkDuplicateRouteNames.js.map +1 -1
  150. package/lib/module/checkSerializable.js +0 -8
  151. package/lib/module/checkSerializable.js.map +1 -1
  152. package/lib/module/createNavigationContainerRef.js +0 -10
  153. package/lib/module/createNavigationContainerRef.js.map +1 -1
  154. package/lib/module/createNavigatorFactory.js +0 -2
  155. package/lib/module/createNavigatorFactory.js.map +1 -1
  156. package/lib/module/findFocusedRoute.js +5 -9
  157. package/lib/module/findFocusedRoute.js.map +1 -1
  158. package/lib/module/fromEntries.js +0 -2
  159. package/lib/module/fromEntries.js.map +1 -1
  160. package/lib/module/getActionFromState.js +11 -21
  161. package/lib/module/getActionFromState.js.map +1 -1
  162. package/lib/module/getFocusedRouteNameFromRoute.js +7 -6
  163. package/lib/module/getFocusedRouteNameFromRoute.js.map +1 -1
  164. package/lib/module/getPathFromState.js +25 -49
  165. package/lib/module/getPathFromState.js.map +1 -1
  166. package/lib/module/getStateFromPath.js +48 -98
  167. package/lib/module/getStateFromPath.js.map +1 -1
  168. package/lib/module/index.js.map +1 -1
  169. package/lib/module/isArrayEqual.js +0 -2
  170. package/lib/module/isArrayEqual.js.map +1 -1
  171. package/lib/module/isRecordEqual.js +0 -3
  172. package/lib/module/isRecordEqual.js.map +1 -1
  173. package/lib/module/types.js +3 -3
  174. package/lib/module/types.js.map +1 -1
  175. package/lib/module/useChildListeners.js +0 -2
  176. package/lib/module/useChildListeners.js.map +1 -1
  177. package/lib/module/useComponent.js +3 -6
  178. package/lib/module/useComponent.js.map +1 -1
  179. package/lib/module/useCurrentRender.js +0 -2
  180. package/lib/module/useCurrentRender.js.map +1 -1
  181. package/lib/module/useDescriptors.js +11 -11
  182. package/lib/module/useDescriptors.js.map +1 -1
  183. package/lib/module/useEventEmitter.js +2 -21
  184. package/lib/module/useEventEmitter.js.map +1 -1
  185. package/lib/module/useFocusEffect.js +2 -15
  186. package/lib/module/useFocusEffect.js.map +1 -1
  187. package/lib/module/useFocusEvents.js +9 -10
  188. package/lib/module/useFocusEvents.js.map +1 -1
  189. package/lib/module/useFocusedListenersChildrenAdapter.js +0 -3
  190. package/lib/module/useFocusedListenersChildrenAdapter.js.map +1 -1
  191. package/lib/module/useIsFocused.js +1 -3
  192. package/lib/module/useIsFocused.js.map +1 -1
  193. package/lib/module/useKeyedChildListeners.js +0 -1
  194. package/lib/module/useKeyedChildListeners.js.map +1 -1
  195. package/lib/module/useNavigation.js +3 -5
  196. package/lib/module/useNavigation.js.map +1 -1
  197. package/lib/module/useNavigationBuilder.js +37 -63
  198. package/lib/module/useNavigationBuilder.js.map +1 -1
  199. package/lib/module/useNavigationCache.js +18 -24
  200. package/lib/module/useNavigationCache.js.map +1 -1
  201. package/lib/module/useNavigationContainerRef.js +0 -2
  202. package/lib/module/useNavigationContainerRef.js.map +1 -1
  203. package/lib/module/useNavigationHelpers.js +4 -9
  204. package/lib/module/useNavigationHelpers.js.map +1 -1
  205. package/lib/module/useNavigationState.js +5 -4
  206. package/lib/module/useNavigationState.js.map +1 -1
  207. package/lib/module/useOnAction.js +8 -19
  208. package/lib/module/useOnAction.js.map +1 -1
  209. package/lib/module/useOnGetState.js +6 -8
  210. package/lib/module/useOnGetState.js.map +1 -1
  211. package/lib/module/useOnPreventRemove.js +9 -14
  212. package/lib/module/useOnPreventRemove.js.map +1 -1
  213. package/lib/module/useOnRouteFocus.js +0 -3
  214. package/lib/module/useOnRouteFocus.js.map +1 -1
  215. package/lib/module/useOptionsGetters.js +5 -17
  216. package/lib/module/useOptionsGetters.js.map +1 -1
  217. package/lib/module/usePreventRemove.js +1 -2
  218. package/lib/module/usePreventRemove.js.map +1 -1
  219. package/lib/module/usePreventRemoveContext.js +0 -2
  220. package/lib/module/usePreventRemoveContext.js.map +1 -1
  221. package/lib/module/useRegisterNavigator.js +1 -3
  222. package/lib/module/useRegisterNavigator.js.map +1 -1
  223. package/lib/module/useRoute.js +0 -3
  224. package/lib/module/useRoute.js.map +1 -1
  225. package/lib/module/useRouteCache.js +1 -6
  226. package/lib/module/useRouteCache.js.map +1 -1
  227. package/lib/module/useScheduleUpdate.js +1 -3
  228. package/lib/module/useScheduleUpdate.js.map +1 -1
  229. package/lib/module/useSyncState.js +9 -13
  230. package/lib/module/useSyncState.js.map +1 -1
  231. package/lib/module/validatePathConfig.js +0 -6
  232. package/lib/module/validatePathConfig.js.map +1 -1
  233. package/lib/typescript/src/BaseNavigationContainer.d.ts +1 -0
  234. package/lib/typescript/src/BaseNavigationContainer.d.ts.map +1 -0
  235. package/lib/typescript/src/CurrentRenderContext.d.ts +1 -0
  236. package/lib/typescript/src/CurrentRenderContext.d.ts.map +1 -0
  237. package/lib/typescript/src/EnsureSingleNavigator.d.ts +1 -0
  238. package/lib/typescript/src/EnsureSingleNavigator.d.ts.map +1 -0
  239. package/lib/typescript/src/Group.d.ts +1 -0
  240. package/lib/typescript/src/Group.d.ts.map +1 -0
  241. package/lib/typescript/src/NavigationBuilderContext.d.ts +1 -0
  242. package/lib/typescript/src/NavigationBuilderContext.d.ts.map +1 -0
  243. package/lib/typescript/src/NavigationContainerRefContext.d.ts +1 -0
  244. package/lib/typescript/src/NavigationContainerRefContext.d.ts.map +1 -0
  245. package/lib/typescript/src/NavigationContext.d.ts +1 -0
  246. package/lib/typescript/src/NavigationContext.d.ts.map +1 -0
  247. package/lib/typescript/src/NavigationHelpersContext.d.ts +1 -0
  248. package/lib/typescript/src/NavigationHelpersContext.d.ts.map +1 -0
  249. package/lib/typescript/src/NavigationRouteContext.d.ts +1 -0
  250. package/lib/typescript/src/NavigationRouteContext.d.ts.map +1 -0
  251. package/lib/typescript/src/NavigationStateContext.d.ts +1 -0
  252. package/lib/typescript/src/NavigationStateContext.d.ts.map +1 -0
  253. package/lib/typescript/src/PreventRemoveContext.d.ts +1 -0
  254. package/lib/typescript/src/PreventRemoveContext.d.ts.map +1 -0
  255. package/lib/typescript/src/PreventRemoveProvider.d.ts +1 -0
  256. package/lib/typescript/src/PreventRemoveProvider.d.ts.map +1 -0
  257. package/lib/typescript/src/SceneView.d.ts +1 -0
  258. package/lib/typescript/src/SceneView.d.ts.map +1 -0
  259. package/lib/typescript/src/Screen.d.ts +1 -0
  260. package/lib/typescript/src/Screen.d.ts.map +1 -0
  261. package/lib/typescript/src/StaticContainer.d.ts +1 -0
  262. package/lib/typescript/src/StaticContainer.d.ts.map +1 -0
  263. package/lib/typescript/src/UnhandledActionContext.d.ts +1 -0
  264. package/lib/typescript/src/UnhandledActionContext.d.ts.map +1 -0
  265. package/lib/typescript/src/checkDuplicateRouteNames.d.ts +1 -0
  266. package/lib/typescript/src/checkDuplicateRouteNames.d.ts.map +1 -0
  267. package/lib/typescript/src/checkSerializable.d.ts +1 -0
  268. package/lib/typescript/src/checkSerializable.d.ts.map +1 -0
  269. package/lib/typescript/src/createNavigationContainerRef.d.ts +1 -0
  270. package/lib/typescript/src/createNavigationContainerRef.d.ts.map +1 -0
  271. package/lib/typescript/src/createNavigatorFactory.d.ts +1 -0
  272. package/lib/typescript/src/createNavigatorFactory.d.ts.map +1 -0
  273. package/lib/typescript/src/findFocusedRoute.d.ts +1 -0
  274. package/lib/typescript/src/findFocusedRoute.d.ts.map +1 -0
  275. package/lib/typescript/src/fromEntries.d.ts +1 -0
  276. package/lib/typescript/src/fromEntries.d.ts.map +1 -0
  277. package/lib/typescript/src/getActionFromState.d.ts +1 -0
  278. package/lib/typescript/src/getActionFromState.d.ts.map +1 -0
  279. package/lib/typescript/src/getFocusedRouteNameFromRoute.d.ts +1 -0
  280. package/lib/typescript/src/getFocusedRouteNameFromRoute.d.ts.map +1 -0
  281. package/lib/typescript/src/getPathFromState.d.ts +1 -0
  282. package/lib/typescript/src/getPathFromState.d.ts.map +1 -0
  283. package/lib/typescript/src/getStateFromPath.d.ts +1 -0
  284. package/lib/typescript/src/getStateFromPath.d.ts.map +1 -0
  285. package/lib/typescript/src/index.d.ts +1 -0
  286. package/lib/typescript/src/index.d.ts.map +1 -0
  287. package/lib/typescript/src/isArrayEqual.d.ts +1 -0
  288. package/lib/typescript/src/isArrayEqual.d.ts.map +1 -0
  289. package/lib/typescript/src/isRecordEqual.d.ts +1 -0
  290. package/lib/typescript/src/isRecordEqual.d.ts.map +1 -0
  291. package/lib/typescript/src/types.d.ts +1 -0
  292. package/lib/typescript/src/types.d.ts.map +1 -0
  293. package/lib/typescript/src/useChildListeners.d.ts +1 -0
  294. package/lib/typescript/src/useChildListeners.d.ts.map +1 -0
  295. package/lib/typescript/src/useComponent.d.ts +1 -0
  296. package/lib/typescript/src/useComponent.d.ts.map +1 -0
  297. package/lib/typescript/src/useCurrentRender.d.ts +1 -0
  298. package/lib/typescript/src/useCurrentRender.d.ts.map +1 -0
  299. package/lib/typescript/src/useDescriptors.d.ts +1 -0
  300. package/lib/typescript/src/useDescriptors.d.ts.map +1 -0
  301. package/lib/typescript/src/useEventEmitter.d.ts +1 -0
  302. package/lib/typescript/src/useEventEmitter.d.ts.map +1 -0
  303. package/lib/typescript/src/useFocusEffect.d.ts +1 -0
  304. package/lib/typescript/src/useFocusEffect.d.ts.map +1 -0
  305. package/lib/typescript/src/useFocusEvents.d.ts +1 -0
  306. package/lib/typescript/src/useFocusEvents.d.ts.map +1 -0
  307. package/lib/typescript/src/useFocusedListenersChildrenAdapter.d.ts +1 -0
  308. package/lib/typescript/src/useFocusedListenersChildrenAdapter.d.ts.map +1 -0
  309. package/lib/typescript/src/useIsFocused.d.ts +1 -0
  310. package/lib/typescript/src/useIsFocused.d.ts.map +1 -0
  311. package/lib/typescript/src/useKeyedChildListeners.d.ts +1 -0
  312. package/lib/typescript/src/useKeyedChildListeners.d.ts.map +1 -0
  313. package/lib/typescript/src/useNavigation.d.ts +1 -0
  314. package/lib/typescript/src/useNavigation.d.ts.map +1 -0
  315. package/lib/typescript/src/useNavigationBuilder.d.ts +1 -0
  316. package/lib/typescript/src/useNavigationBuilder.d.ts.map +1 -0
  317. package/lib/typescript/src/useNavigationCache.d.ts +1 -0
  318. package/lib/typescript/src/useNavigationCache.d.ts.map +1 -0
  319. package/lib/typescript/src/useNavigationContainerRef.d.ts +1 -0
  320. package/lib/typescript/src/useNavigationContainerRef.d.ts.map +1 -0
  321. package/lib/typescript/src/useNavigationHelpers.d.ts +1 -0
  322. package/lib/typescript/src/useNavigationHelpers.d.ts.map +1 -0
  323. package/lib/typescript/src/useNavigationState.d.ts +1 -0
  324. package/lib/typescript/src/useNavigationState.d.ts.map +1 -0
  325. package/lib/typescript/src/useOnAction.d.ts +1 -0
  326. package/lib/typescript/src/useOnAction.d.ts.map +1 -0
  327. package/lib/typescript/src/useOnGetState.d.ts +1 -0
  328. package/lib/typescript/src/useOnGetState.d.ts.map +1 -0
  329. package/lib/typescript/src/useOnPreventRemove.d.ts +1 -0
  330. package/lib/typescript/src/useOnPreventRemove.d.ts.map +1 -0
  331. package/lib/typescript/src/useOnRouteFocus.d.ts +1 -0
  332. package/lib/typescript/src/useOnRouteFocus.d.ts.map +1 -0
  333. package/lib/typescript/src/useOptionsGetters.d.ts +1 -0
  334. package/lib/typescript/src/useOptionsGetters.d.ts.map +1 -0
  335. package/lib/typescript/src/usePreventRemove.d.ts +1 -0
  336. package/lib/typescript/src/usePreventRemove.d.ts.map +1 -0
  337. package/lib/typescript/src/usePreventRemoveContext.d.ts +1 -0
  338. package/lib/typescript/src/usePreventRemoveContext.d.ts.map +1 -0
  339. package/lib/typescript/src/useRegisterNavigator.d.ts +1 -0
  340. package/lib/typescript/src/useRegisterNavigator.d.ts.map +1 -0
  341. package/lib/typescript/src/useRoute.d.ts +1 -0
  342. package/lib/typescript/src/useRoute.d.ts.map +1 -0
  343. package/lib/typescript/src/useRouteCache.d.ts +1 -0
  344. package/lib/typescript/src/useRouteCache.d.ts.map +1 -0
  345. package/lib/typescript/src/useScheduleUpdate.d.ts +1 -0
  346. package/lib/typescript/src/useScheduleUpdate.d.ts.map +1 -0
  347. package/lib/typescript/src/useSyncState.d.ts +1 -0
  348. package/lib/typescript/src/useSyncState.d.ts.map +1 -0
  349. package/lib/typescript/src/validatePathConfig.d.ts +1 -0
  350. package/lib/typescript/src/validatePathConfig.d.ts.map +1 -0
  351. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"names":["React","NavigationBuilderContext","useFocusedListenersChildrenAdapter","navigation","focusedListeners","addListener","useContext","listener","useCallback","callback","isFocused","handled","result","useEffect"],"sources":["useFocusedListenersChildrenAdapter.tsx"],"sourcesContent":["import type { ParamListBase } from '@react-navigation/routers';\nimport * as React from 'react';\n\nimport NavigationBuilderContext, {\n FocusedNavigationCallback,\n FocusedNavigationListener,\n} from './NavigationBuilderContext';\nimport type { NavigationHelpers } from './types';\n\ntype Options = {\n navigation: NavigationHelpers<ParamListBase>;\n focusedListeners: FocusedNavigationListener[];\n};\n\n/**\n * Hook for passing focus callback to children\n */\nexport default function useFocusedListenersChildrenAdapter({\n navigation,\n focusedListeners,\n}: Options) {\n const { addListener } = React.useContext(NavigationBuilderContext);\n\n const listener = React.useCallback(\n (callback: FocusedNavigationCallback<any>) => {\n if (navigation.isFocused()) {\n for (const listener of focusedListeners) {\n const { handled, result } = listener(callback);\n\n if (handled) {\n return { handled, result };\n }\n }\n\n return { handled: true, result: callback(navigation) };\n } else {\n return { handled: false, result: null };\n }\n },\n [focusedListeners, navigation]\n );\n\n React.useEffect(\n () => addListener?.('focus', listener),\n [addListener, listener]\n );\n}\n"],"mappings":"AACA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAEA,OAAOC,wBAAP,MAGO,4BAHP;;AAWA;AACA;AACA;AACA,eAAe,SAASC,kCAAT,OAGH;EAAA,IAH+C;IACzDC,UADyD;IAEzDC;EAFyD,CAG/C;EACV,MAAM;IAAEC;EAAF,IAAkBL,KAAK,CAACM,UAAN,CAAiBL,wBAAjB,CAAxB;EAEA,MAAMM,QAAQ,GAAGP,KAAK,CAACQ,WAAN,CACdC,QAAD,IAA8C;IAC5C,IAAIN,UAAU,CAACO,SAAX,EAAJ,EAA4B;MAC1B,KAAK,MAAMH,QAAX,IAAuBH,gBAAvB,EAAyC;QACvC,MAAM;UAAEO,OAAF;UAAWC;QAAX,IAAsBL,QAAQ,CAACE,QAAD,CAApC;;QAEA,IAAIE,OAAJ,EAAa;UACX,OAAO;YAAEA,OAAF;YAAWC;UAAX,CAAP;QACD;MACF;;MAED,OAAO;QAAED,OAAO,EAAE,IAAX;QAAiBC,MAAM,EAAEH,QAAQ,CAACN,UAAD;MAAjC,CAAP;IACD,CAVD,MAUO;MACL,OAAO;QAAEQ,OAAO,EAAE,KAAX;QAAkBC,MAAM,EAAE;MAA1B,CAAP;IACD;EACF,CAfc,EAgBf,CAACR,gBAAD,EAAmBD,UAAnB,CAhBe,CAAjB;EAmBAH,KAAK,CAACa,SAAN,CACE,MAAMR,WAAN,aAAMA,WAAN,uBAAMA,WAAW,CAAG,OAAH,EAAYE,QAAZ,CADnB,EAEE,CAACF,WAAD,EAAcE,QAAd,CAFF;AAID"}
1
+ {"version":3,"names":["React","NavigationBuilderContext","useFocusedListenersChildrenAdapter","navigation","focusedListeners","addListener","useContext","listener","useCallback","callback","isFocused","handled","result","useEffect"],"sourceRoot":"../../src","sources":["useFocusedListenersChildrenAdapter.tsx"],"mappings":"AACA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,OAAOC,wBAAwB,MAGxB,4BAA4B;AAQnC;AACA;AACA;AACA,eAAe,SAASC,kCAAkC,OAG9C;EAAA,IAH+C;IACzDC,UAAU;IACVC;EACO,CAAC;EACR,MAAM;IAAEC;EAAY,CAAC,GAAGL,KAAK,CAACM,UAAU,CAACL,wBAAwB,CAAC;EAElE,MAAMM,QAAQ,GAAGP,KAAK,CAACQ,WAAW,CAC/BC,QAAwC,IAAK;IAC5C,IAAIN,UAAU,CAACO,SAAS,EAAE,EAAE;MAC1B,KAAK,MAAMH,QAAQ,IAAIH,gBAAgB,EAAE;QACvC,MAAM;UAAEO,OAAO;UAAEC;QAAO,CAAC,GAAGL,QAAQ,CAACE,QAAQ,CAAC;QAE9C,IAAIE,OAAO,EAAE;UACX,OAAO;YAAEA,OAAO;YAAEC;UAAO,CAAC;QAC5B;MACF;MAEA,OAAO;QAAED,OAAO,EAAE,IAAI;QAAEC,MAAM,EAAEH,QAAQ,CAACN,UAAU;MAAE,CAAC;IACxD,CAAC,MAAM;MACL,OAAO;QAAEQ,OAAO,EAAE,KAAK;QAAEC,MAAM,EAAE;MAAK,CAAC;IACzC;EACF,CAAC,EACD,CAACR,gBAAgB,EAAED,UAAU,CAAC,CAC/B;EAEDH,KAAK,CAACa,SAAS,CACb,MAAMR,WAAW,aAAXA,WAAW,uBAAXA,WAAW,CAAG,OAAO,EAAEE,QAAQ,CAAC,EACtC,CAACF,WAAW,EAAEE,QAAQ,CAAC,CACxB;AACH"}
@@ -1,16 +1,15 @@
1
1
  import * as React from 'react';
2
2
  import { useState } from 'react';
3
3
  import useNavigation from './useNavigation';
4
+
4
5
  /**
5
6
  * Hook to get the current focus state of the screen. Returns a `true` if screen is focused, otherwise `false`.
6
7
  * This can be used if a component needs to render something based on the focus state.
7
8
  */
8
-
9
9
  export default function useIsFocused() {
10
10
  const navigation = useNavigation();
11
11
  const [isFocused, setIsFocused] = useState(navigation.isFocused);
12
12
  const valueToReturn = navigation.isFocused();
13
-
14
13
  if (isFocused !== valueToReturn) {
15
14
  // If the value has changed since the last render, we need to update it.
16
15
  // This could happen if we missed an update from the event listeners during re-render.
@@ -19,7 +18,6 @@ export default function useIsFocused() {
19
18
  // This is the same logic as in https://github.com/facebook/react/tree/master/packages/use-subscription
20
19
  setIsFocused(valueToReturn);
21
20
  }
22
-
23
21
  React.useEffect(() => {
24
22
  const unsubscribeFocus = navigation.addListener('focus', () => setIsFocused(true));
25
23
  const unsubscribeBlur = navigation.addListener('blur', () => setIsFocused(false));
@@ -1 +1 @@
1
- {"version":3,"names":["React","useState","useNavigation","useIsFocused","navigation","isFocused","setIsFocused","valueToReturn","useEffect","unsubscribeFocus","addListener","unsubscribeBlur","useDebugValue"],"sources":["useIsFocused.tsx"],"sourcesContent":["import * as React from 'react';\nimport { useState } from 'react';\n\nimport useNavigation from './useNavigation';\n\n/**\n * Hook to get the current focus state of the screen. Returns a `true` if screen is focused, otherwise `false`.\n * This can be used if a component needs to render something based on the focus state.\n */\nexport default function useIsFocused(): boolean {\n const navigation = useNavigation();\n const [isFocused, setIsFocused] = useState(navigation.isFocused);\n\n const valueToReturn = navigation.isFocused();\n\n if (isFocused !== valueToReturn) {\n // If the value has changed since the last render, we need to update it.\n // This could happen if we missed an update from the event listeners during re-render.\n // React will process this update immediately, so the old subscription value won't be committed.\n // It is still nice to avoid returning a mismatched value though, so let's override the return value.\n // This is the same logic as in https://github.com/facebook/react/tree/master/packages/use-subscription\n setIsFocused(valueToReturn);\n }\n\n React.useEffect(() => {\n const unsubscribeFocus = navigation.addListener('focus', () =>\n setIsFocused(true)\n );\n\n const unsubscribeBlur = navigation.addListener('blur', () =>\n setIsFocused(false)\n );\n\n return () => {\n unsubscribeFocus();\n unsubscribeBlur();\n };\n }, [navigation]);\n\n React.useDebugValue(valueToReturn);\n\n return valueToReturn;\n}\n"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AACA,SAASC,QAAT,QAAyB,OAAzB;AAEA,OAAOC,aAAP,MAA0B,iBAA1B;AAEA;AACA;AACA;AACA;;AACA,eAAe,SAASC,YAAT,GAAiC;EAC9C,MAAMC,UAAU,GAAGF,aAAa,EAAhC;EACA,MAAM,CAACG,SAAD,EAAYC,YAAZ,IAA4BL,QAAQ,CAACG,UAAU,CAACC,SAAZ,CAA1C;EAEA,MAAME,aAAa,GAAGH,UAAU,CAACC,SAAX,EAAtB;;EAEA,IAAIA,SAAS,KAAKE,aAAlB,EAAiC;IAC/B;IACA;IACA;IACA;IACA;IACAD,YAAY,CAACC,aAAD,CAAZ;EACD;;EAEDP,KAAK,CAACQ,SAAN,CAAgB,MAAM;IACpB,MAAMC,gBAAgB,GAAGL,UAAU,CAACM,WAAX,CAAuB,OAAvB,EAAgC,MACvDJ,YAAY,CAAC,IAAD,CADW,CAAzB;IAIA,MAAMK,eAAe,GAAGP,UAAU,CAACM,WAAX,CAAuB,MAAvB,EAA+B,MACrDJ,YAAY,CAAC,KAAD,CADU,CAAxB;IAIA,OAAO,MAAM;MACXG,gBAAgB;MAChBE,eAAe;IAChB,CAHD;EAID,CAbD,EAaG,CAACP,UAAD,CAbH;EAeAJ,KAAK,CAACY,aAAN,CAAoBL,aAApB;EAEA,OAAOA,aAAP;AACD"}
1
+ {"version":3,"names":["React","useState","useNavigation","useIsFocused","navigation","isFocused","setIsFocused","valueToReturn","useEffect","unsubscribeFocus","addListener","unsubscribeBlur","useDebugValue"],"sourceRoot":"../../src","sources":["useIsFocused.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAC9B,SAASC,QAAQ,QAAQ,OAAO;AAEhC,OAAOC,aAAa,MAAM,iBAAiB;;AAE3C;AACA;AACA;AACA;AACA,eAAe,SAASC,YAAY,GAAY;EAC9C,MAAMC,UAAU,GAAGF,aAAa,EAAE;EAClC,MAAM,CAACG,SAAS,EAAEC,YAAY,CAAC,GAAGL,QAAQ,CAACG,UAAU,CAACC,SAAS,CAAC;EAEhE,MAAME,aAAa,GAAGH,UAAU,CAACC,SAAS,EAAE;EAE5C,IAAIA,SAAS,KAAKE,aAAa,EAAE;IAC/B;IACA;IACA;IACA;IACA;IACAD,YAAY,CAACC,aAAa,CAAC;EAC7B;EAEAP,KAAK,CAACQ,SAAS,CAAC,MAAM;IACpB,MAAMC,gBAAgB,GAAGL,UAAU,CAACM,WAAW,CAAC,OAAO,EAAE,MACvDJ,YAAY,CAAC,IAAI,CAAC,CACnB;IAED,MAAMK,eAAe,GAAGP,UAAU,CAACM,WAAW,CAAC,MAAM,EAAE,MACrDJ,YAAY,CAAC,KAAK,CAAC,CACpB;IAED,OAAO,MAAM;MACXG,gBAAgB,EAAE;MAClBE,eAAe,EAAE;IACnB,CAAC;EACH,CAAC,EAAE,CAACP,UAAU,CAAC,CAAC;EAEhBJ,KAAK,CAACY,aAAa,CAACL,aAAa,CAAC;EAElC,OAAOA,aAAa;AACtB"}
@@ -1,5 +1,4 @@
1
1
  import * as React from 'react';
2
-
3
2
  /**
4
3
  * Hook which lets child navigators add getters to be called for obtaining rehydrated state.
5
4
  */
@@ -1 +1 @@
1
- {"version":3,"names":["React","useKeyedChildListeners","current","keyedListeners","useRef","Object","assign","create","getState","beforeRemove","addKeyedListener","useCallback","type","key","listener","undefined"],"sources":["useKeyedChildListeners.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport type { KeyedListenerMap } from './NavigationBuilderContext';\n\n/**\n * Hook which lets child navigators add getters to be called for obtaining rehydrated state.\n */\nexport default function useKeyedChildListeners() {\n const { current: keyedListeners } = React.useRef<{\n [K in keyof KeyedListenerMap]: Record<\n string,\n KeyedListenerMap[K] | undefined\n >;\n }>(\n Object.assign(Object.create(null), {\n getState: {},\n beforeRemove: {},\n })\n );\n\n const addKeyedListener = React.useCallback(\n <T extends keyof KeyedListenerMap>(\n type: T,\n key: string,\n listener: KeyedListenerMap[T]\n ) => {\n // @ts-expect-error: according to ref stated above you can use `key` to index type\n keyedListeners[type][key] = listener;\n\n return () => {\n // @ts-expect-error: according to ref stated above you can use `key` to index type\n keyedListeners[type][key] = undefined;\n };\n },\n [keyedListeners]\n );\n\n return {\n keyedListeners,\n addKeyedListener,\n };\n}\n"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;;AAIA;AACA;AACA;AACA,eAAe,SAASC,sBAAT,GAAkC;EAC/C,MAAM;IAAEC,OAAO,EAAEC;EAAX,IAA8BH,KAAK,CAACI,MAAN,CAMlCC,MAAM,CAACC,MAAP,CAAcD,MAAM,CAACE,MAAP,CAAc,IAAd,CAAd,EAAmC;IACjCC,QAAQ,EAAE,EADuB;IAEjCC,YAAY,EAAE;EAFmB,CAAnC,CANkC,CAApC;EAYA,MAAMC,gBAAgB,GAAGV,KAAK,CAACW,WAAN,CACvB,CACEC,IADF,EAEEC,GAFF,EAGEC,QAHF,KAIK;IACH;IACAX,cAAc,CAACS,IAAD,CAAd,CAAqBC,GAArB,IAA4BC,QAA5B;IAEA,OAAO,MAAM;MACX;MACAX,cAAc,CAACS,IAAD,CAAd,CAAqBC,GAArB,IAA4BE,SAA5B;IACD,CAHD;EAID,CAbsB,EAcvB,CAACZ,cAAD,CAduB,CAAzB;EAiBA,OAAO;IACLA,cADK;IAELO;EAFK,CAAP;AAID"}
1
+ {"version":3,"names":["React","useKeyedChildListeners","current","keyedListeners","useRef","Object","assign","create","getState","beforeRemove","addKeyedListener","useCallback","type","key","listener","undefined"],"sourceRoot":"../../src","sources":["useKeyedChildListeners.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAI9B;AACA;AACA;AACA,eAAe,SAASC,sBAAsB,GAAG;EAC/C,MAAM;IAAEC,OAAO,EAAEC;EAAe,CAAC,GAAGH,KAAK,CAACI,MAAM,CAM9CC,MAAM,CAACC,MAAM,CAACD,MAAM,CAACE,MAAM,CAAC,IAAI,CAAC,EAAE;IACjCC,QAAQ,EAAE,CAAC,CAAC;IACZC,YAAY,EAAE,CAAC;EACjB,CAAC,CAAC,CACH;EAED,MAAMC,gBAAgB,GAAGV,KAAK,CAACW,WAAW,CACxC,CACEC,IAAO,EACPC,GAAW,EACXC,QAA6B,KAC1B;IACH;IACAX,cAAc,CAACS,IAAI,CAAC,CAACC,GAAG,CAAC,GAAGC,QAAQ;IAEpC,OAAO,MAAM;MACX;MACAX,cAAc,CAACS,IAAI,CAAC,CAACC,GAAG,CAAC,GAAGE,SAAS;IACvC,CAAC;EACH,CAAC,EACD,CAACZ,cAAc,CAAC,CACjB;EAED,OAAO;IACLA,cAAc;IACdO;EACF,CAAC;AACH"}
@@ -1,7 +1,6 @@
1
1
  import * as React from 'react';
2
2
  import NavigationContainerRefContext from './NavigationContainerRefContext';
3
3
  import NavigationContext from './NavigationContext';
4
-
5
4
  /**
6
5
  * Hook to access the navigation prop of the parent screen anywhere.
7
6
  *
@@ -10,12 +9,11 @@ import NavigationContext from './NavigationContext';
10
9
  export default function useNavigation() {
11
10
  const root = React.useContext(NavigationContainerRefContext);
12
11
  const navigation = React.useContext(NavigationContext);
13
-
14
12
  if (navigation === undefined && root === undefined) {
15
13
  throw new Error("Couldn't find a navigation object. Is your component inside NavigationContainer?");
16
- } // FIXME: Figure out a better way to do this
17
-
14
+ }
18
15
 
19
- return navigation !== null && navigation !== void 0 ? navigation : root;
16
+ // FIXME: Figure out a better way to do this
17
+ return navigation ?? root;
20
18
  }
21
19
  //# sourceMappingURL=useNavigation.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["React","NavigationContainerRefContext","NavigationContext","useNavigation","root","useContext","navigation","undefined","Error"],"sources":["useNavigation.tsx"],"sourcesContent":["import * as React from 'react';\n\nimport NavigationContainerRefContext from './NavigationContainerRefContext';\nimport NavigationContext from './NavigationContext';\nimport type { NavigationProp } from './types';\n\n/**\n * Hook to access the navigation prop of the parent screen anywhere.\n *\n * @returns Navigation prop of the parent screen.\n */\nexport default function useNavigation<\n T = NavigationProp<ReactNavigation.RootParamList>\n>(): T {\n const root = React.useContext(NavigationContainerRefContext);\n const navigation = React.useContext(NavigationContext);\n\n if (navigation === undefined && root === undefined) {\n throw new Error(\n \"Couldn't find a navigation object. Is your component inside NavigationContainer?\"\n );\n }\n\n // FIXME: Figure out a better way to do this\n return (navigation ?? root) as unknown as T;\n}\n"],"mappings":"AAAA,OAAO,KAAKA,KAAZ,MAAuB,OAAvB;AAEA,OAAOC,6BAAP,MAA0C,iCAA1C;AACA,OAAOC,iBAAP,MAA8B,qBAA9B;;AAGA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,aAAT,GAER;EACL,MAAMC,IAAI,GAAGJ,KAAK,CAACK,UAAN,CAAiBJ,6BAAjB,CAAb;EACA,MAAMK,UAAU,GAAGN,KAAK,CAACK,UAAN,CAAiBH,iBAAjB,CAAnB;;EAEA,IAAII,UAAU,KAAKC,SAAf,IAA4BH,IAAI,KAAKG,SAAzC,EAAoD;IAClD,MAAM,IAAIC,KAAJ,CACJ,kFADI,CAAN;EAGD,CARI,CAUL;;;EACA,OAAQF,UAAR,aAAQA,UAAR,cAAQA,UAAR,GAAsBF,IAAtB;AACD"}
1
+ {"version":3,"names":["React","NavigationContainerRefContext","NavigationContext","useNavigation","root","useContext","navigation","undefined","Error"],"sourceRoot":"../../src","sources":["useNavigation.tsx"],"mappings":"AAAA,OAAO,KAAKA,KAAK,MAAM,OAAO;AAE9B,OAAOC,6BAA6B,MAAM,iCAAiC;AAC3E,OAAOC,iBAAiB,MAAM,qBAAqB;AAGnD;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,aAAa,GAE9B;EACL,MAAMC,IAAI,GAAGJ,KAAK,CAACK,UAAU,CAACJ,6BAA6B,CAAC;EAC5D,MAAMK,UAAU,GAAGN,KAAK,CAACK,UAAU,CAACH,iBAAiB,CAAC;EAEtD,IAAII,UAAU,KAAKC,SAAS,IAAIH,IAAI,KAAKG,SAAS,EAAE;IAClD,MAAM,IAAIC,KAAK,CACb,kFAAkF,CACnF;EACH;;EAEA;EACA,OAAQF,UAAU,IAAIF,IAAI;AAC5B"}
@@ -23,31 +23,29 @@ import useOnAction from './useOnAction';
23
23
  import useOnGetState from './useOnGetState';
24
24
  import useOnRouteFocus from './useOnRouteFocus';
25
25
  import useRegisterNavigator from './useRegisterNavigator';
26
- import useScheduleUpdate from './useScheduleUpdate'; // This is to make TypeScript compiler happy
27
- // eslint-disable-next-line babel/no-unused-expressions
26
+ import useScheduleUpdate from './useScheduleUpdate';
28
27
 
28
+ // This is to make TypeScript compiler happy
29
+ // eslint-disable-next-line babel/no-unused-expressions
29
30
  PrivateValueStore;
30
-
31
31
  const isValidKey = key => key === undefined || typeof key === 'string' && key !== '';
32
+
32
33
  /**
33
34
  * Extract route config object from React children elements.
34
35
  *
35
36
  * @param children React Elements to extract the config from.
36
37
  */
37
-
38
-
39
38
  const getRouteConfigsFromChildren = (children, groupKey, groupOptions) => {
40
39
  const configs = React.Children.toArray(children).reduce((acc, child) => {
41
40
  var _child$type, _child$props;
42
-
43
41
  if ( /*#__PURE__*/React.isValidElement(child)) {
44
42
  if (child.type === Screen) {
45
43
  // We can only extract the config from `Screen` elements
46
44
  // If something else was rendered, it's probably a bug
45
+
47
46
  if (!isValidKey(child.props.navigationKey)) {
48
47
  throw new Error(`Got an invalid 'navigationKey' prop (${JSON.stringify(child.props.navigationKey)}) for the screen '${child.props.name}'. It must be a non-empty string or 'undefined'.`);
49
48
  }
50
-
51
49
  acc.push({
52
50
  keys: [groupKey, child.props.navigationKey],
53
51
  options: groupOptions,
@@ -55,22 +53,19 @@ const getRouteConfigsFromChildren = (children, groupKey, groupOptions) => {
55
53
  });
56
54
  return acc;
57
55
  }
58
-
59
56
  if (child.type === React.Fragment || child.type === Group) {
60
57
  if (!isValidKey(child.props.navigationKey)) {
61
58
  throw new Error(`Got an invalid 'navigationKey' prop (${JSON.stringify(child.props.navigationKey)}) for the group. It must be a non-empty string or 'undefined'.`);
62
- } // When we encounter a fragment or group, we need to dive into its children to extract the configs
63
- // This is handy to conditionally define a group of screens
64
-
59
+ }
65
60
 
61
+ // When we encounter a fragment or group, we need to dive into its children to extract the configs
62
+ // This is handy to conditionally define a group of screens
66
63
  acc.push(...getRouteConfigsFromChildren(child.props.children, child.props.navigationKey, child.type !== Group ? groupOptions : groupOptions != null ? [...groupOptions, child.props.screenOptions] : [child.props.screenOptions]));
67
64
  return acc;
68
65
  }
69
66
  }
70
-
71
67
  throw new Error(`A navigator can only contain 'Screen', 'Group' or 'React.Fragment' as its direct children (found ${/*#__PURE__*/React.isValidElement(child) ? `'${typeof child.type === 'string' ? child.type : (_child$type = child.type) === null || _child$type === void 0 ? void 0 : _child$type.name}'${(_child$props = child.props) !== null && _child$props !== void 0 && _child$props.name ? ` for the screen '${child.props.name}'` : ''}` : typeof child === 'object' ? JSON.stringify(child) : `'${String(child)}'`}). To render this component in the navigator, pass it in the 'component' prop to 'Screen'.`);
72
68
  }, []);
73
-
74
69
  if (process.env.NODE_ENV !== 'production') {
75
70
  configs.forEach(config => {
76
71
  const {
@@ -79,36 +74,28 @@ const getRouteConfigsFromChildren = (children, groupKey, groupOptions) => {
79
74
  component,
80
75
  getComponent
81
76
  } = config.props;
82
-
83
77
  if (typeof name !== 'string' || !name) {
84
78
  throw new Error(`Got an invalid name (${JSON.stringify(name)}) for the screen. It must be a non-empty string.`);
85
79
  }
86
-
87
80
  if (children != null || component !== undefined || getComponent !== undefined) {
88
81
  if (children != null && component !== undefined) {
89
82
  throw new Error(`Got both 'component' and 'children' props for the screen '${name}'. You must pass only one of them.`);
90
83
  }
91
-
92
84
  if (children != null && getComponent !== undefined) {
93
85
  throw new Error(`Got both 'getComponent' and 'children' props for the screen '${name}'. You must pass only one of them.`);
94
86
  }
95
-
96
87
  if (component !== undefined && getComponent !== undefined) {
97
88
  throw new Error(`Got both 'component' and 'getComponent' props for the screen '${name}'. You must pass only one of them.`);
98
89
  }
99
-
100
90
  if (children != null && typeof children !== 'function') {
101
91
  throw new Error(`Got an invalid value for 'children' prop for the screen '${name}'. It must be a function returning a React Element.`);
102
92
  }
103
-
104
93
  if (component !== undefined && !isValidElementType(component)) {
105
94
  throw new Error(`Got an invalid value for 'component' prop for the screen '${name}'. It must be a valid React Component.`);
106
95
  }
107
-
108
96
  if (getComponent !== undefined && typeof getComponent !== 'function') {
109
97
  throw new Error(`Got an invalid value for 'getComponent' prop for the screen '${name}'. It must be a function returning a React Component.`);
110
98
  }
111
-
112
99
  if (typeof component === 'function') {
113
100
  if (component.name === 'component') {
114
101
  // Inline anonymous functions passed in the `component` prop will have the name of the prop
@@ -124,9 +111,9 @@ const getRouteConfigsFromChildren = (children, groupKey, groupOptions) => {
124
111
  }
125
112
  });
126
113
  }
127
-
128
114
  return configs;
129
115
  };
116
+
130
117
  /**
131
118
  * Hook for building navigators.
132
119
  *
@@ -134,8 +121,6 @@ const getRouteConfigsFromChildren = (children, groupKey, groupOptions) => {
134
121
  * @param options Options object containing `children` and additional options for the router.
135
122
  * @returns An object containing `state`, `navigation`, `descriptors` objects.
136
123
  */
137
-
138
-
139
124
  export default function useNavigationBuilder(createRouter, options) {
140
125
  const navigatorKey = useRegisterNavigator();
141
126
  const route = React.useContext(NavigationRouteContext);
@@ -146,7 +131,8 @@ export default function useNavigationBuilder(createRouter, options) {
146
131
  } = options;
147
132
  const {
148
133
  current: router
149
- } = React.useRef(createRouter({ ...rest,
134
+ } = React.useRef(createRouter({
135
+ ...rest,
150
136
  ...(route !== null && route !== void 0 && route.params && route.params.state == null && route.params.initial !== false && typeof route.params.screen === 'string' ? {
151
137
  initialRouteName: route.params.screen
152
138
  } : null)
@@ -156,13 +142,12 @@ export default function useNavigationBuilder(createRouter, options) {
156
142
  if (config.props.name in acc) {
157
143
  throw new Error(`A navigator cannot contain multiple 'Screen' components with the same name (found duplicate screen named '${config.props.name}')`);
158
144
  }
159
-
160
145
  acc[config.props.name] = config;
161
146
  return acc;
162
147
  }, {});
163
148
  const routeNames = routeConfigs.map(config => config.props.name);
164
149
  const routeKeyList = routeNames.reduce((acc, curr) => {
165
- acc[curr] = screens[curr].keys.map(key => key !== null && key !== void 0 ? key : '').join(':');
150
+ acc[curr] = screens[curr].keys.map(key => key ?? '').join(':');
166
151
  return acc;
167
152
  }, {});
168
153
  const routeParamList = routeNames.reduce((acc, curr) => {
@@ -175,11 +160,9 @@ export default function useNavigationBuilder(createRouter, options) {
175
160
  const routeGetIdList = routeNames.reduce((acc, curr) => Object.assign(acc, {
176
161
  [curr]: screens[curr].props.getId
177
162
  }), {});
178
-
179
163
  if (!routeNames.length) {
180
164
  throw new Error("Couldn't find any screens for the navigator. Have you defined any screens as its children?");
181
165
  }
182
-
183
166
  const isStateValid = React.useCallback(state => state.type === undefined || state.type === router.type, [router.type]);
184
167
  const isStateInitialized = React.useCallback(state => state !== undefined && state.stale === false && isStateValid(state), [isStateValid]);
185
168
  const {
@@ -202,28 +185,27 @@ export default function useNavigationBuilder(createRouter, options) {
202
185
  // This would lead to old data preservation on main navigator unmount
203
186
  return;
204
187
  }
205
-
206
188
  setCurrentState(state);
207
189
  }, [setCurrentState]);
208
190
  const [initializedState, isFirstStateInitialization] = React.useMemo(() => {
209
191
  var _route$params4;
210
-
211
192
  const initialRouteParamList = routeNames.reduce((acc, curr) => {
212
193
  var _route$params, _route$params2, _route$params3;
213
-
214
194
  const {
215
195
  initialParams
216
196
  } = screens[curr].props;
217
197
  const initialParamsFromParams = (route === null || route === void 0 ? void 0 : (_route$params = route.params) === null || _route$params === void 0 ? void 0 : _route$params.state) == null && (route === null || route === void 0 ? void 0 : (_route$params2 = route.params) === null || _route$params2 === void 0 ? void 0 : _route$params2.initial) !== false && (route === null || route === void 0 ? void 0 : (_route$params3 = route.params) === null || _route$params3 === void 0 ? void 0 : _route$params3.screen) === curr ? route.params.params : undefined;
218
- acc[curr] = initialParams !== undefined || initialParamsFromParams !== undefined ? { ...initialParams,
198
+ acc[curr] = initialParams !== undefined || initialParamsFromParams !== undefined ? {
199
+ ...initialParams,
219
200
  ...initialParamsFromParams
220
201
  } : undefined;
221
202
  return acc;
222
- }, {}); // If the current state isn't initialized on first render, we initialize it
203
+ }, {});
204
+
205
+ // If the current state isn't initialized on first render, we initialize it
223
206
  // We also need to re-initialize it if the state passed from parent was changed (maybe due to reset)
224
207
  // Otherwise assume that the state was provided as initial state
225
208
  // So we need to rehydrate it to make it usable
226
-
227
209
  if ((currentState === undefined || !isStateValid(currentState)) && (route === null || route === void 0 ? void 0 : (_route$params4 = route.params) === null || _route$params4 === void 0 ? void 0 : _route$params4.state) == null) {
228
210
  return [router.getInitialState({
229
211
  routeNames,
@@ -231,32 +213,31 @@ export default function useNavigationBuilder(createRouter, options) {
231
213
  routeGetIdList
232
214
  }), true];
233
215
  } else {
234
- var _route$params$state, _route$params5;
235
-
236
- return [router.getRehydratedState((_route$params$state = route === null || route === void 0 ? void 0 : (_route$params5 = route.params) === null || _route$params5 === void 0 ? void 0 : _route$params5.state) !== null && _route$params$state !== void 0 ? _route$params$state : currentState, {
216
+ var _route$params5;
217
+ return [router.getRehydratedState((route === null || route === void 0 ? void 0 : (_route$params5 = route.params) === null || _route$params5 === void 0 ? void 0 : _route$params5.state) ?? currentState, {
237
218
  routeNames,
238
219
  routeParamList: initialRouteParamList,
239
220
  routeGetIdList
240
221
  }), false];
241
- } // We explicitly don't include routeNames, route.params etc. in the dep list
222
+ }
223
+ // We explicitly don't include routeNames, route.params etc. in the dep list
242
224
  // below. We want to avoid forcing a new state to be calculated in those cases
243
225
  // Instead, we handle changes to these in the nextState code below. Note
244
226
  // that some changes to routeConfigs are explicitly ignored, such as changes
245
227
  // to initialParams
246
228
  // eslint-disable-next-line react-hooks/exhaustive-deps
247
-
248
229
  }, [currentState, router, isStateValid]);
249
230
  const previousRouteKeyListRef = React.useRef(routeKeyList);
250
231
  React.useEffect(() => {
251
232
  previousRouteKeyListRef.current = routeKeyList;
252
233
  });
253
234
  const previousRouteKeyList = previousRouteKeyListRef.current;
254
- let state = // If the state isn't initialized, or stale, use the state we initialized instead
235
+ let state =
236
+ // If the state isn't initialized, or stale, use the state we initialized instead
255
237
  // The state won't update until there's a change needed in the state we have initalized locally
256
238
  // So it'll be `undefined` or stale until the first navigation event happens
257
239
  isStateInitialized(currentState) ? currentState : initializedState;
258
240
  let nextState = state;
259
-
260
241
  if (!isArrayEqual(state.routeNames, routeNames) || !isRecordEqual(routeKeyList, previousRouteKeyList)) {
261
242
  // When the list of route names change, the router should handle it to remove invalid routes
262
243
  nextState = router.getStateForRouteNamesChange(state, {
@@ -266,16 +247,13 @@ export default function useNavigationBuilder(createRouter, options) {
266
247
  routeKeyChanges: Object.keys(routeKeyList).filter(name => previousRouteKeyList.hasOwnProperty(name) && routeKeyList[name] !== previousRouteKeyList[name])
267
248
  });
268
249
  }
269
-
270
250
  const previousNestedParamsRef = React.useRef(route === null || route === void 0 ? void 0 : route.params);
271
251
  React.useEffect(() => {
272
252
  previousNestedParamsRef.current = route === null || route === void 0 ? void 0 : route.params;
273
253
  }, [route === null || route === void 0 ? void 0 : route.params]);
274
-
275
254
  if (route !== null && route !== void 0 && route.params) {
276
255
  const previousParams = previousNestedParamsRef.current;
277
256
  let action;
278
-
279
257
  if (typeof route.params.state === 'object' && route.params.state != null && route.params !== previousParams) {
280
258
  // If the route was updated with new state, we should reset to it
281
259
  action = CommonActions.reset(route.params.state);
@@ -286,9 +264,9 @@ export default function useNavigationBuilder(createRouter, options) {
286
264
  params: route.params.params,
287
265
  path: route.params.path
288
266
  });
289
- } // The update should be limited to current navigator only, so we call the router manually
290
-
267
+ }
291
268
 
269
+ // The update should be limited to current navigator only, so we call the router manually
292
270
  const updatedState = action ? router.getStateForAction(nextState, action, {
293
271
  routeNames,
294
272
  routeParamList,
@@ -300,28 +278,26 @@ export default function useNavigationBuilder(createRouter, options) {
300
278
  routeGetIdList
301
279
  }) : nextState;
302
280
  }
303
-
304
281
  const shouldUpdate = state !== nextState;
305
282
  useScheduleUpdate(() => {
306
283
  if (shouldUpdate) {
307
284
  // If the state needs to be updated, we'll schedule an update
308
285
  setState(nextState);
309
286
  }
310
- }); // The up-to-date state will come in next render, but we don't need to wait for it
287
+ });
288
+
289
+ // The up-to-date state will come in next render, but we don't need to wait for it
311
290
  // We can't use the outdated state since the screens have changed, which will cause error due to mismatched config
312
291
  // So we override the state object we return to use the latest state as soon as possible
313
-
314
292
  state = nextState;
315
293
  React.useEffect(() => {
316
294
  setKey(navigatorKey);
317
-
318
295
  if (!getIsInitial()) {
319
296
  // If it's not initial render, we need to update the state
320
297
  // This will make sure that our container gets notifier of state changes due to new mounts
321
298
  // This is necessary for proper screen tracking, URL updates etc.
322
299
  setState(nextState);
323
300
  }
324
-
325
301
  return () => {
326
302
  // We need to clean up state for this navigator on unmount
327
303
  // We do it in a timeout because we need to detect if another navigator mounted in the meantime
@@ -332,11 +308,13 @@ export default function useNavigationBuilder(createRouter, options) {
332
308
  cleanUpState();
333
309
  }
334
310
  }, 0);
335
- }; // eslint-disable-next-line react-hooks/exhaustive-deps
336
- }, []); // We initialize this ref here to avoid a new getState getting initialized
311
+ };
312
+ // eslint-disable-next-line react-hooks/exhaustive-deps
313
+ }, []);
314
+
315
+ // We initialize this ref here to avoid a new getState getting initialized
337
316
  // whenever initializedState changes. We want getState to have access to the
338
317
  // latest initializedState, but don't need it to change when that happens
339
-
340
318
  const initializedStateRef = React.useRef();
341
319
  initializedStateRef.current = initializedState;
342
320
  const getState = React.useCallback(() => {
@@ -346,12 +324,9 @@ export default function useNavigationBuilder(createRouter, options) {
346
324
  const emitter = useEventEmitter(e => {
347
325
  let routeNames = [];
348
326
  let route;
349
-
350
327
  if (e.target) {
351
328
  var _route;
352
-
353
329
  route = state.routes.find(route => route.key === e.target);
354
-
355
330
  if ((_route = route) !== null && _route !== void 0 && _route.name) {
356
331
  routeNames.push(route.name);
357
332
  }
@@ -359,17 +334,15 @@ export default function useNavigationBuilder(createRouter, options) {
359
334
  route = state.routes[state.index];
360
335
  routeNames.push(...Object.keys(screens).filter(name => {
361
336
  var _route2;
362
-
363
337
  return ((_route2 = route) === null || _route2 === void 0 ? void 0 : _route2.name) === name;
364
338
  }));
365
339
  }
366
-
367
340
  if (route == null) {
368
341
  return;
369
342
  }
370
-
371
343
  const navigation = descriptors[route.key].navigation;
372
- const listeners = [].concat( // Get an array of listeners for all screens + common listeners on navigator
344
+ const listeners = [].concat(
345
+ // Get an array of listeners for all screens + common listeners on navigator
373
346
  ...[screenListeners, ...routeNames.map(name => {
374
347
  const {
375
348
  listeners
@@ -381,7 +354,8 @@ export default function useNavigationBuilder(createRouter, options) {
381
354
  navigation
382
355
  }) : listeners;
383
356
  return map ? Object.keys(map).filter(type => type === e.type).map(type => map === null || map === void 0 ? void 0 : map[type]) : undefined;
384
- })) // We don't want same listener to be called multiple times for same event
357
+ }))
358
+ // We don't want same listener to be called multiple times for same event
385
359
  // So we remove any duplicate functions from the array
386
360
  .filter((cb, i, self) => cb && self.lastIndexOf(cb) === i);
387
361
  listeners.forEach(listener => listener === null || listener === void 0 ? void 0 : listener(e));
@@ -1 +1 @@
1
- {"version":3,"names":["CommonActions","React","isValidElementType","Group","isArrayEqual","isRecordEqual","NavigationHelpersContext","NavigationRouteContext","NavigationStateContext","PreventRemoveProvider","Screen","PrivateValueStore","useChildListeners","useComponent","useCurrentRender","useDescriptors","useEventEmitter","useFocusedListenersChildrenAdapter","useFocusEvents","useKeyedChildListeners","useNavigationHelpers","useOnAction","useOnGetState","useOnRouteFocus","useRegisterNavigator","useScheduleUpdate","isValidKey","key","undefined","getRouteConfigsFromChildren","children","groupKey","groupOptions","configs","Children","toArray","reduce","acc","child","isValidElement","type","props","navigationKey","Error","JSON","stringify","name","push","keys","options","Fragment","screenOptions","String","process","env","NODE_ENV","forEach","config","component","getComponent","console","warn","test","useNavigationBuilder","createRouter","navigatorKey","route","useContext","screenListeners","rest","current","router","useRef","params","state","initial","screen","initialRouteName","routeConfigs","screens","routeNames","map","routeKeyList","curr","join","routeParamList","initialParams","routeGetIdList","Object","assign","getId","length","isStateValid","useCallback","isStateInitialized","stale","currentState","getState","getCurrentState","setState","setCurrentState","setKey","getKey","getIsInitial","stateCleanedUp","cleanUpState","initializedState","isFirstStateInitialization","useMemo","initialRouteParamList","initialParamsFromParams","getInitialState","getRehydratedState","previousRouteKeyListRef","useEffect","previousRouteKeyList","nextState","getStateForRouteNamesChange","routeKeyChanges","filter","hasOwnProperty","previousNestedParamsRef","previousParams","action","reset","navigate","path","updatedState","getStateForAction","shouldUpdate","setTimeout","initializedStateRef","emitter","e","target","routes","find","index","navigation","descriptors","listeners","concat","cb","i","self","lastIndexOf","listener","emit","data","childListeners","addListener","keyedListeners","addKeyedListener","onAction","actionListeners","beforeRemoveListeners","beforeRemove","routerConfigOptions","onRouteFocus","id","focusedListeners","focus","getStateListeners","defaultScreenOptions","NavigationContent"],"sources":["useNavigationBuilder.tsx"],"sourcesContent":["import {\n CommonActions,\n DefaultRouterOptions,\n NavigationAction,\n NavigationState,\n ParamListBase,\n PartialState,\n Route,\n Router,\n RouterConfigOptions,\n RouterFactory,\n} from '@react-navigation/routers';\nimport * as React from 'react';\nimport { isValidElementType } from 'react-is';\n\nimport Group from './Group';\nimport isArrayEqual from './isArrayEqual';\nimport isRecordEqual from './isRecordEqual';\nimport NavigationHelpersContext from './NavigationHelpersContext';\nimport NavigationRouteContext from './NavigationRouteContext';\nimport NavigationStateContext from './NavigationStateContext';\nimport PreventRemoveProvider from './PreventRemoveProvider';\nimport Screen from './Screen';\nimport {\n DefaultNavigatorOptions,\n EventMapBase,\n EventMapCore,\n NavigatorScreenParams,\n PrivateValueStore,\n RouteConfig,\n} from './types';\nimport useChildListeners from './useChildListeners';\nimport useComponent from './useComponent';\nimport useCurrentRender from './useCurrentRender';\nimport useDescriptors, { ScreenConfigWithParent } from './useDescriptors';\nimport useEventEmitter from './useEventEmitter';\nimport useFocusedListenersChildrenAdapter from './useFocusedListenersChildrenAdapter';\nimport useFocusEvents from './useFocusEvents';\nimport useKeyedChildListeners from './useKeyedChildListeners';\nimport useNavigationHelpers from './useNavigationHelpers';\nimport useOnAction from './useOnAction';\nimport useOnGetState from './useOnGetState';\nimport useOnRouteFocus from './useOnRouteFocus';\nimport useRegisterNavigator from './useRegisterNavigator';\nimport useScheduleUpdate from './useScheduleUpdate';\n\n// This is to make TypeScript compiler happy\n// eslint-disable-next-line babel/no-unused-expressions\nPrivateValueStore;\n\ntype NavigatorRoute<State extends NavigationState> = {\n key: string;\n params?: NavigatorScreenParams<ParamListBase, State>;\n};\n\nconst isValidKey = (key: unknown) =>\n key === undefined || (typeof key === 'string' && key !== '');\n\n/**\n * Extract route config object from React children elements.\n *\n * @param children React Elements to extract the config from.\n */\nconst getRouteConfigsFromChildren = <\n State extends NavigationState,\n ScreenOptions extends {},\n EventMap extends EventMapBase\n>(\n children: React.ReactNode,\n groupKey?: string,\n groupOptions?: ScreenConfigWithParent<\n State,\n ScreenOptions,\n EventMap\n >['options']\n) => {\n const configs = React.Children.toArray(children).reduce<\n ScreenConfigWithParent<State, ScreenOptions, EventMap>[]\n >((acc, child) => {\n if (React.isValidElement(child)) {\n if (child.type === Screen) {\n // We can only extract the config from `Screen` elements\n // If something else was rendered, it's probably a bug\n\n if (!isValidKey(child.props.navigationKey)) {\n throw new Error(\n `Got an invalid 'navigationKey' prop (${JSON.stringify(\n child.props.navigationKey\n )}) for the screen '${\n child.props.name\n }'. It must be a non-empty string or 'undefined'.`\n );\n }\n\n acc.push({\n keys: [groupKey, child.props.navigationKey],\n options: groupOptions,\n props: child.props as RouteConfig<\n ParamListBase,\n string,\n State,\n ScreenOptions,\n EventMap\n >,\n });\n return acc;\n }\n\n if (child.type === React.Fragment || child.type === Group) {\n if (!isValidKey(child.props.navigationKey)) {\n throw new Error(\n `Got an invalid 'navigationKey' prop (${JSON.stringify(\n child.props.navigationKey\n )}) for the group. It must be a non-empty string or 'undefined'.`\n );\n }\n\n // When we encounter a fragment or group, we need to dive into its children to extract the configs\n // This is handy to conditionally define a group of screens\n acc.push(\n ...getRouteConfigsFromChildren<State, ScreenOptions, EventMap>(\n child.props.children,\n child.props.navigationKey,\n child.type !== Group\n ? groupOptions\n : groupOptions != null\n ? [...groupOptions, child.props.screenOptions]\n : [child.props.screenOptions]\n )\n );\n return acc;\n }\n }\n\n throw new Error(\n `A navigator can only contain 'Screen', 'Group' or 'React.Fragment' as its direct children (found ${\n React.isValidElement(child)\n ? `'${\n typeof child.type === 'string' ? child.type : child.type?.name\n }'${\n child.props?.name ? ` for the screen '${child.props.name}'` : ''\n }`\n : typeof child === 'object'\n ? JSON.stringify(child)\n : `'${String(child)}'`\n }). To render this component in the navigator, pass it in the 'component' prop to 'Screen'.`\n );\n }, []);\n\n if (process.env.NODE_ENV !== 'production') {\n configs.forEach((config) => {\n const { name, children, component, getComponent } = config.props;\n\n if (typeof name !== 'string' || !name) {\n throw new Error(\n `Got an invalid name (${JSON.stringify(\n name\n )}) for the screen. It must be a non-empty string.`\n );\n }\n\n if (\n children != null ||\n component !== undefined ||\n getComponent !== undefined\n ) {\n if (children != null && component !== undefined) {\n throw new Error(\n `Got both 'component' and 'children' props for the screen '${name}'. You must pass only one of them.`\n );\n }\n\n if (children != null && getComponent !== undefined) {\n throw new Error(\n `Got both 'getComponent' and 'children' props for the screen '${name}'. You must pass only one of them.`\n );\n }\n\n if (component !== undefined && getComponent !== undefined) {\n throw new Error(\n `Got both 'component' and 'getComponent' props for the screen '${name}'. You must pass only one of them.`\n );\n }\n\n if (children != null && typeof children !== 'function') {\n throw new Error(\n `Got an invalid value for 'children' prop for the screen '${name}'. It must be a function returning a React Element.`\n );\n }\n\n if (component !== undefined && !isValidElementType(component)) {\n throw new Error(\n `Got an invalid value for 'component' prop for the screen '${name}'. It must be a valid React Component.`\n );\n }\n\n if (getComponent !== undefined && typeof getComponent !== 'function') {\n throw new Error(\n `Got an invalid value for 'getComponent' prop for the screen '${name}'. It must be a function returning a React Component.`\n );\n }\n\n if (typeof component === 'function') {\n if (component.name === 'component') {\n // Inline anonymous functions passed in the `component` prop will have the name of the prop\n // It's relatively safe to assume that it's not a component since it should also have PascalCase name\n // We won't catch all scenarios here, but this should catch a good chunk of incorrect use.\n console.warn(\n `Looks like you're passing an inline function for 'component' prop for the screen '${name}' (e.g. component={() => <SomeComponent />}). Passing an inline function will cause the component state to be lost on re-render and cause perf issues since it's re-created every render. You can pass the function as children to 'Screen' instead to achieve the desired behaviour.`\n );\n } else if (/^[a-z]/.test(component.name)) {\n console.warn(\n `Got a component with the name '${component.name}' for the screen '${name}'. React Components must start with an uppercase letter. If you're passing a regular function and not a component, pass it as children to 'Screen' instead. Otherwise capitalize your component's name.`\n );\n }\n }\n } else {\n throw new Error(\n `Couldn't find a 'component', 'getComponent' or 'children' prop for the screen '${name}'. This can happen if you passed 'undefined'. You likely forgot to export your component from the file it's defined in, or mixed up default import and named import when importing.`\n );\n }\n });\n }\n\n return configs;\n};\n\n/**\n * Hook for building navigators.\n *\n * @param createRouter Factory method which returns router object.\n * @param options Options object containing `children` and additional options for the router.\n * @returns An object containing `state`, `navigation`, `descriptors` objects.\n */\nexport default function useNavigationBuilder<\n State extends NavigationState,\n RouterOptions extends DefaultRouterOptions,\n ActionHelpers extends Record<string, () => void>,\n ScreenOptions extends {},\n EventMap extends Record<string, any>\n>(\n createRouter: RouterFactory<State, any, RouterOptions>,\n options: DefaultNavigatorOptions<\n ParamListBase,\n State,\n ScreenOptions,\n EventMap\n > &\n RouterOptions\n) {\n const navigatorKey = useRegisterNavigator();\n\n const route = React.useContext(NavigationRouteContext) as\n | NavigatorRoute<State>\n | undefined;\n\n const { children, screenListeners, ...rest } = options;\n const { current: router } = React.useRef<Router<State, any>>(\n createRouter({\n ...(rest as unknown as RouterOptions),\n ...(route?.params &&\n route.params.state == null &&\n route.params.initial !== false &&\n typeof route.params.screen === 'string'\n ? { initialRouteName: route.params.screen }\n : null),\n })\n );\n\n const routeConfigs = getRouteConfigsFromChildren<\n State,\n ScreenOptions,\n EventMap\n >(children);\n\n const screens = routeConfigs.reduce<\n Record<string, ScreenConfigWithParent<State, ScreenOptions, EventMap>>\n >((acc, config) => {\n if (config.props.name in acc) {\n throw new Error(\n `A navigator cannot contain multiple 'Screen' components with the same name (found duplicate screen named '${config.props.name}')`\n );\n }\n\n acc[config.props.name] = config;\n return acc;\n }, {});\n\n const routeNames = routeConfigs.map((config) => config.props.name);\n const routeKeyList = routeNames.reduce<Record<string, React.Key | undefined>>(\n (acc, curr) => {\n acc[curr] = screens[curr].keys.map((key) => key ?? '').join(':');\n return acc;\n },\n {}\n );\n const routeParamList = routeNames.reduce<Record<string, object | undefined>>(\n (acc, curr) => {\n const { initialParams } = screens[curr].props;\n acc[curr] = initialParams;\n return acc;\n },\n {}\n );\n const routeGetIdList = routeNames.reduce<\n RouterConfigOptions['routeGetIdList']\n >(\n (acc, curr) =>\n Object.assign(acc, {\n [curr]: screens[curr].props.getId,\n }),\n {}\n );\n\n if (!routeNames.length) {\n throw new Error(\n \"Couldn't find any screens for the navigator. Have you defined any screens as its children?\"\n );\n }\n\n const isStateValid = React.useCallback(\n (state: NavigationState | PartialState<NavigationState>) =>\n state.type === undefined || state.type === router.type,\n [router.type]\n );\n\n const isStateInitialized = React.useCallback(\n (state: NavigationState | PartialState<NavigationState> | undefined) =>\n state !== undefined && state.stale === false && isStateValid(state),\n [isStateValid]\n );\n\n const {\n state: currentState,\n getState: getCurrentState,\n setState: setCurrentState,\n setKey,\n getKey,\n getIsInitial,\n } = React.useContext(NavigationStateContext);\n\n const stateCleanedUp = React.useRef(false);\n\n const cleanUpState = React.useCallback(() => {\n setCurrentState(undefined);\n stateCleanedUp.current = true;\n }, [setCurrentState]);\n\n const setState = React.useCallback(\n (state: NavigationState | PartialState<NavigationState> | undefined) => {\n if (stateCleanedUp.current) {\n // State might have been already cleaned up due to unmount\n // We do not want to expose API allowing to override this\n // This would lead to old data preservation on main navigator unmount\n return;\n }\n setCurrentState(state);\n },\n [setCurrentState]\n );\n\n const [initializedState, isFirstStateInitialization] = React.useMemo(() => {\n const initialRouteParamList = routeNames.reduce<\n Record<string, object | undefined>\n >((acc, curr) => {\n const { initialParams } = screens[curr].props;\n const initialParamsFromParams =\n route?.params?.state == null &&\n route?.params?.initial !== false &&\n route?.params?.screen === curr\n ? route.params.params\n : undefined;\n\n acc[curr] =\n initialParams !== undefined || initialParamsFromParams !== undefined\n ? {\n ...initialParams,\n ...initialParamsFromParams,\n }\n : undefined;\n\n return acc;\n }, {});\n\n // If the current state isn't initialized on first render, we initialize it\n // We also need to re-initialize it if the state passed from parent was changed (maybe due to reset)\n // Otherwise assume that the state was provided as initial state\n // So we need to rehydrate it to make it usable\n if (\n (currentState === undefined || !isStateValid(currentState)) &&\n route?.params?.state == null\n ) {\n return [\n router.getInitialState({\n routeNames,\n routeParamList: initialRouteParamList,\n routeGetIdList,\n }),\n true,\n ];\n } else {\n return [\n router.getRehydratedState(\n route?.params?.state ?? (currentState as PartialState<State>),\n {\n routeNames,\n routeParamList: initialRouteParamList,\n routeGetIdList,\n }\n ),\n false,\n ];\n }\n // We explicitly don't include routeNames, route.params etc. in the dep list\n // below. We want to avoid forcing a new state to be calculated in those cases\n // Instead, we handle changes to these in the nextState code below. Note\n // that some changes to routeConfigs are explicitly ignored, such as changes\n // to initialParams\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, [currentState, router, isStateValid]);\n\n const previousRouteKeyListRef = React.useRef(routeKeyList);\n\n React.useEffect(() => {\n previousRouteKeyListRef.current = routeKeyList;\n });\n\n const previousRouteKeyList = previousRouteKeyListRef.current;\n\n let state =\n // If the state isn't initialized, or stale, use the state we initialized instead\n // The state won't update until there's a change needed in the state we have initalized locally\n // So it'll be `undefined` or stale until the first navigation event happens\n isStateInitialized(currentState)\n ? (currentState as State)\n : (initializedState as State);\n\n let nextState: State = state;\n\n if (\n !isArrayEqual(state.routeNames, routeNames) ||\n !isRecordEqual(routeKeyList, previousRouteKeyList)\n ) {\n // When the list of route names change, the router should handle it to remove invalid routes\n nextState = router.getStateForRouteNamesChange(state, {\n routeNames,\n routeParamList,\n routeGetIdList,\n routeKeyChanges: Object.keys(routeKeyList).filter(\n (name) =>\n previousRouteKeyList.hasOwnProperty(name) &&\n routeKeyList[name] !== previousRouteKeyList[name]\n ),\n });\n }\n\n const previousNestedParamsRef = React.useRef(route?.params);\n\n React.useEffect(() => {\n previousNestedParamsRef.current = route?.params;\n }, [route?.params]);\n\n if (route?.params) {\n const previousParams = previousNestedParamsRef.current;\n\n let action: CommonActions.Action | undefined;\n\n if (\n typeof route.params.state === 'object' &&\n route.params.state != null &&\n route.params !== previousParams\n ) {\n // If the route was updated with new state, we should reset to it\n action = CommonActions.reset(route.params.state);\n } else if (\n typeof route.params.screen === 'string' &&\n ((route.params.initial === false && isFirstStateInitialization) ||\n route.params !== previousParams)\n ) {\n // If the route was updated with new screen name and/or params, we should navigate there\n action = CommonActions.navigate({\n name: route.params.screen,\n params: route.params.params,\n path: route.params.path,\n });\n }\n\n // The update should be limited to current navigator only, so we call the router manually\n const updatedState = action\n ? router.getStateForAction(nextState, action, {\n routeNames,\n routeParamList,\n routeGetIdList,\n })\n : null;\n\n nextState =\n updatedState !== null\n ? router.getRehydratedState(updatedState, {\n routeNames,\n routeParamList,\n routeGetIdList,\n })\n : nextState;\n }\n\n const shouldUpdate = state !== nextState;\n\n useScheduleUpdate(() => {\n if (shouldUpdate) {\n // If the state needs to be updated, we'll schedule an update\n setState(nextState);\n }\n });\n\n // The up-to-date state will come in next render, but we don't need to wait for it\n // We can't use the outdated state since the screens have changed, which will cause error due to mismatched config\n // So we override the state object we return to use the latest state as soon as possible\n state = nextState;\n\n React.useEffect(() => {\n setKey(navigatorKey);\n\n if (!getIsInitial()) {\n // If it's not initial render, we need to update the state\n // This will make sure that our container gets notifier of state changes due to new mounts\n // This is necessary for proper screen tracking, URL updates etc.\n setState(nextState);\n }\n\n return () => {\n // We need to clean up state for this navigator on unmount\n // We do it in a timeout because we need to detect if another navigator mounted in the meantime\n // For example, if another navigator has started rendering, we should skip cleanup\n // Otherwise, our cleanup step will cleanup state for the other navigator and re-initialize it\n setTimeout(() => {\n if (getCurrentState() !== undefined && getKey() === navigatorKey) {\n cleanUpState();\n }\n }, 0);\n };\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n // We initialize this ref here to avoid a new getState getting initialized\n // whenever initializedState changes. We want getState to have access to the\n // latest initializedState, but don't need it to change when that happens\n const initializedStateRef = React.useRef<State>();\n initializedStateRef.current = initializedState;\n\n const getState = React.useCallback((): State => {\n const currentState = getCurrentState();\n\n return isStateInitialized(currentState)\n ? (currentState as State)\n : (initializedStateRef.current as State);\n }, [getCurrentState, isStateInitialized]);\n\n const emitter = useEventEmitter<EventMapCore<State>>((e) => {\n let routeNames = [];\n\n let route: Route<string> | undefined;\n\n if (e.target) {\n route = state.routes.find((route) => route.key === e.target);\n\n if (route?.name) {\n routeNames.push(route.name);\n }\n } else {\n route = state.routes[state.index];\n routeNames.push(\n ...Object.keys(screens).filter((name) => route?.name === name)\n );\n }\n\n if (route == null) {\n return;\n }\n\n const navigation = descriptors[route.key].navigation;\n\n const listeners = ([] as (((e: any) => void) | undefined)[])\n .concat(\n // Get an array of listeners for all screens + common listeners on navigator\n ...[\n screenListeners,\n ...routeNames.map((name) => {\n const { listeners } = screens[name].props;\n return listeners;\n }),\n ].map((listeners) => {\n const map =\n typeof listeners === 'function'\n ? listeners({ route: route as any, navigation })\n : listeners;\n\n return map\n ? Object.keys(map)\n .filter((type) => type === e.type)\n .map((type) => map?.[type])\n : undefined;\n })\n )\n // We don't want same listener to be called multiple times for same event\n // So we remove any duplicate functions from the array\n .filter((cb, i, self) => cb && self.lastIndexOf(cb) === i);\n\n listeners.forEach((listener) => listener?.(e));\n });\n\n useFocusEvents({ state, emitter });\n\n React.useEffect(() => {\n emitter.emit({ type: 'state', data: { state } });\n }, [emitter, state]);\n\n const { listeners: childListeners, addListener } = useChildListeners();\n\n const { keyedListeners, addKeyedListener } = useKeyedChildListeners();\n\n const onAction = useOnAction({\n router,\n getState,\n setState,\n key: route?.key,\n actionListeners: childListeners.action,\n beforeRemoveListeners: keyedListeners.beforeRemove,\n routerConfigOptions: {\n routeNames,\n routeParamList,\n routeGetIdList,\n },\n emitter,\n });\n\n const onRouteFocus = useOnRouteFocus({\n router,\n key: route?.key,\n getState,\n setState,\n });\n\n const navigation = useNavigationHelpers<\n State,\n ActionHelpers,\n NavigationAction,\n EventMap\n >({\n id: options.id,\n onAction,\n getState,\n emitter,\n router,\n });\n\n useFocusedListenersChildrenAdapter({\n navigation,\n focusedListeners: childListeners.focus,\n });\n\n useOnGetState({\n getState,\n getStateListeners: keyedListeners.getState,\n });\n\n const descriptors = useDescriptors<\n State,\n ActionHelpers,\n ScreenOptions,\n EventMap\n >({\n state,\n screens,\n navigation,\n screenOptions: options.screenOptions,\n defaultScreenOptions: options.defaultScreenOptions,\n onAction,\n getState,\n setState,\n onRouteFocus,\n addListener,\n addKeyedListener,\n router,\n // @ts-expect-error: this should have both core and custom events, but too much work right now\n emitter,\n });\n\n useCurrentRender({\n state,\n navigation,\n descriptors,\n });\n\n const NavigationContent = useComponent((children: React.ReactNode) => (\n <NavigationHelpersContext.Provider value={navigation}>\n <PreventRemoveProvider>{children}</PreventRemoveProvider>\n </NavigationHelpersContext.Provider>\n ));\n\n return {\n state,\n navigation,\n descriptors,\n NavigationContent,\n };\n}\n"],"mappings":"AAAA,SACEA,aADF,QAWO,2BAXP;AAYA,OAAO,KAAKC,KAAZ,MAAuB,OAAvB;AACA,SAASC,kBAAT,QAAmC,UAAnC;AAEA,OAAOC,KAAP,MAAkB,SAAlB;AACA,OAAOC,YAAP,MAAyB,gBAAzB;AACA,OAAOC,aAAP,MAA0B,iBAA1B;AACA,OAAOC,wBAAP,MAAqC,4BAArC;AACA,OAAOC,sBAAP,MAAmC,0BAAnC;AACA,OAAOC,sBAAP,MAAmC,0BAAnC;AACA,OAAOC,qBAAP,MAAkC,yBAAlC;AACA,OAAOC,MAAP,MAAmB,UAAnB;AACA,SAKEC,iBALF,QAOO,SAPP;AAQA,OAAOC,iBAAP,MAA8B,qBAA9B;AACA,OAAOC,YAAP,MAAyB,gBAAzB;AACA,OAAOC,gBAAP,MAA6B,oBAA7B;AACA,OAAOC,cAAP,MAAuD,kBAAvD;AACA,OAAOC,eAAP,MAA4B,mBAA5B;AACA,OAAOC,kCAAP,MAA+C,sCAA/C;AACA,OAAOC,cAAP,MAA2B,kBAA3B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B,CADF,CADoC,CAAtC;EAMA,OAAO;IACL4C,KADK;IAELgE,UAFK;IAGLC,WAHK;IAILyB;EAJK,CAAP;AAMD"}
1
+ {"version":3,"names":["CommonActions","React","isValidElementType","Group","isArrayEqual","isRecordEqual","NavigationHelpersContext","NavigationRouteContext","NavigationStateContext","PreventRemoveProvider","Screen","PrivateValueStore","useChildListeners","useComponent","useCurrentRender","useDescriptors","useEventEmitter","useFocusedListenersChildrenAdapter","useFocusEvents","useKeyedChildListeners","useNavigationHelpers","useOnAction","useOnGetState","useOnRouteFocus","useRegisterNavigator","useScheduleUpdate","isValidKey","key","undefined","getRouteConfigsFromChildren","children","groupKey","groupOptions","configs","Children","toArray","reduce","acc","child","isValidElement","type","props","navigationKey","Error","JSON","stringify","name","push","keys","options","Fragment","screenOptions","String","process","env","NODE_ENV","forEach","config","component","getComponent","console","warn","test","useNavigationBuilder","createRouter","navigatorKey","route","useContext","screenListeners","rest","current","router","useRef","params","state","initial","screen","initialRouteName","routeConfigs","screens","routeNames","map","routeKeyList","curr","join","routeParamList","initialParams","routeGetIdList","Object","assign","getId","length","isStateValid","useCallback","isStateInitialized","stale","currentState","getState","getCurrentState","setState","setCurrentState","setKey","getKey","getIsInitial","stateCleanedUp","cleanUpState","initializedState","isFirstStateInitialization","useMemo","initialRouteParamList","initialParamsFromParams","getInitialState","getRehydratedState","previousRouteKeyListRef","useEffect","previousRouteKeyList","nextState","getStateForRouteNamesChange","routeKeyChanges","filter","hasOwnProperty","previousNestedParamsRef","previousParams","action","reset","navigate","path","updatedState","getStateForAction","shouldUpdate","setTimeout","initializedStateRef","emitter","e","target","routes","find","index","navigation","descriptors","listeners","concat","cb","i","self","lastIndexOf","listener","emit","data","childListeners","addListener","keyedListeners","addKeyedListener","onAction","actionListeners","beforeRemoveListeners","beforeRemove","routerConfigOptions","onRouteFocus","id","focusedListeners","focus","getStateListeners","defaultScreenOptions","NavigationContent"],"sourceRoot":"../../src","sources":["useNavigationBuilder.tsx"],"mappings":"A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