one 1.2.47 → 1.2.49
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.
- package/dist/cjs/Root.js +6 -1
- package/dist/cjs/Root.js.map +1 -1
- package/dist/cjs/Root.native.js.map +1 -1
- package/dist/cjs/babel-plugins/one-router-metro.js +4 -1
- package/dist/cjs/babel-plugins/one-router-metro.js.map +1 -1
- package/dist/cjs/babel-plugins/one-router-metro.native.js.map +1 -1
- package/dist/cjs/babel-plugins/remove-server-code.js +3 -1
- package/dist/cjs/babel-plugins/remove-server-code.js.map +1 -1
- package/dist/cjs/babel-plugins/remove-server-code.native.js.map +1 -1
- package/dist/cjs/cli/build.js +31 -8
- package/dist/cjs/cli/build.js.map +1 -1
- package/dist/cjs/cli/build.native.js.map +1 -1
- package/dist/cjs/cli/buildPage.js +14 -4
- package/dist/cjs/cli/buildPage.js.map +1 -1
- package/dist/cjs/cli/buildPage.native.js.map +1 -1
- package/dist/cjs/cli/generateRoutes.js +3 -1
- package/dist/cjs/cli/generateRoutes.js.map +1 -1
- package/dist/cjs/cli/generateRoutes.native.js.map +1 -1
- package/dist/cjs/cli/generateSitemap.js.map +1 -1
- package/dist/cjs/cli/generateSitemap.native.js.map +1 -1
- package/dist/cjs/cli/generateSitemap.test.js +14 -4
- package/dist/cjs/cli/generateSitemap.test.js.map +1 -1
- package/dist/cjs/cli/generateSitemap.test.native.js.map +1 -1
- package/dist/cjs/cli/main.js +4 -2
- package/dist/cjs/cli/main.js.map +1 -1
- package/dist/cjs/cli/main.native.js.map +1 -1
- package/dist/cjs/cli/prebuild.js.map +1 -1
- package/dist/cjs/cli/prebuild.native.js.map +1 -1
- package/dist/cjs/clientLoaderResolver.js.map +1 -1
- package/dist/cjs/clientLoaderResolver.native.js.map +1 -1
- package/dist/cjs/config.js +3 -1
- package/dist/cjs/config.js.map +1 -1
- package/dist/cjs/config.native.js.map +1 -1
- package/dist/cjs/constants.js.map +1 -1
- package/dist/cjs/constants.native.js.map +1 -1
- package/dist/cjs/createApp.js +9 -1
- package/dist/cjs/createApp.js.map +1 -1
- package/dist/cjs/createHandleRequest.js +9 -3
- package/dist/cjs/createHandleRequest.js.map +1 -1
- package/dist/cjs/createHandleRequest.native.js.map +1 -1
- package/dist/cjs/fork/__tests__/getPathFromState.test.js +90 -88
- package/dist/cjs/fork/__tests__/getPathFromState.test.js.map +1 -1
- package/dist/cjs/fork/__tests__/getPathFromState.test.native.js.map +1 -1
- package/dist/cjs/fork/__tests__/getStateFromPath.test.js +163 -86
- package/dist/cjs/fork/__tests__/getStateFromPath.test.js.map +1 -1
- package/dist/cjs/fork/__tests__/getStateFromPath.test.native.js.map +1 -1
- package/dist/cjs/fork/_shared.js.map +1 -1
- package/dist/cjs/fork/_shared.native.js.map +1 -1
- package/dist/cjs/fork/extractPathFromURL.js.map +1 -1
- package/dist/cjs/fork/extractPathFromURL.native.js.map +1 -1
- package/dist/cjs/fork/getPathFromState-mods.js +4 -1
- package/dist/cjs/fork/getPathFromState-mods.js.map +1 -1
- package/dist/cjs/fork/getPathFromState-mods.native.js.map +1 -1
- package/dist/cjs/fork/getPathFromState.js +3 -1
- package/dist/cjs/fork/getPathFromState.js.map +1 -1
- package/dist/cjs/fork/getPathFromState.native.js.map +1 -1
- package/dist/cjs/fork/getStateFromPath-mods.js.map +1 -1
- package/dist/cjs/fork/getStateFromPath-mods.native.js.map +1 -1
- package/dist/cjs/fork/getStateFromPath.js +7 -1
- package/dist/cjs/fork/getStateFromPath.js.map +1 -1
- package/dist/cjs/fork/getStateFromPath.native.js.map +1 -1
- package/dist/cjs/fork/getStateFromPath.test.js +21 -8
- package/dist/cjs/fork/getStateFromPath.test.js.map +1 -1
- package/dist/cjs/fork/getStateFromPath.test.native.js.map +1 -1
- package/dist/cjs/fork/useBackButton.js.map +1 -1
- package/dist/cjs/fork/useDocumentTitle.js +4 -1
- package/dist/cjs/fork/useDocumentTitle.js.map +1 -1
- package/dist/cjs/fork/useLinking.js +4 -1
- package/dist/cjs/fork/useLinking.js.map +1 -1
- package/dist/cjs/fork/validatePathConfig.js.map +1 -1
- package/dist/cjs/fork/validatePathConfig.native.js.map +1 -1
- package/dist/cjs/hooks.js.map +1 -1
- package/dist/cjs/hooks.native.js.map +1 -1
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/layouts/Tabs.js.map +1 -1
- package/dist/cjs/layouts/Tabs.native.js.map +1 -1
- package/dist/cjs/layouts/withLayoutContext.js +10 -8
- package/dist/cjs/layouts/withLayoutContext.js.map +1 -1
- package/dist/cjs/layouts/withLayoutContext.native.js.map +1 -1
- package/dist/cjs/link/Link.js.map +1 -1
- package/dist/cjs/link/Link.native.js.map +1 -1
- package/dist/cjs/link/linking.js +3 -1
- package/dist/cjs/link/linking.js.map +1 -1
- package/dist/cjs/link/linking.native.js.map +1 -1
- package/dist/cjs/link/useLinkTo.js.map +1 -1
- package/dist/cjs/link/useLinkTo.native.js.map +1 -1
- package/dist/cjs/link/useLoadedNavigation.js.map +1 -1
- package/dist/cjs/link/useLoadedNavigation.native.js.map +1 -1
- package/dist/cjs/metro-config/getViteMetroPluginOptions.cjs +6 -8
- package/dist/cjs/metro-config/getViteMetroPluginOptions.js +8 -10
- package/dist/cjs/metro-config/getViteMetroPluginOptions.js.map +1 -1
- package/dist/cjs/metro-config/getViteMetroPluginOptions.native.js +9 -11
- package/dist/cjs/metro-config/getViteMetroPluginOptions.native.js.map +1 -1
- package/dist/cjs/router/Route.js.map +1 -1
- package/dist/cjs/router/Route.native.js.map +1 -1
- package/dist/cjs/router/RouteInfoContext.js +7 -1
- package/dist/cjs/router/RouteInfoContext.js.map +1 -1
- package/dist/cjs/router/RouteInfoContext.native.js.map +1 -1
- package/dist/cjs/router/filterRootHTML.js.map +1 -1
- package/dist/cjs/router/filterRootHTML.native.js.map +1 -1
- package/dist/cjs/router/getLinkingConfig.js.map +1 -1
- package/dist/cjs/router/getLinkingConfig.native.js.map +1 -1
- package/dist/cjs/router/getNormalizedStatePath.js.map +1 -1
- package/dist/cjs/router/getNormalizedStatePath.native.js.map +1 -1
- package/dist/cjs/router/getRoutes.js +3 -1
- package/dist/cjs/router/getRoutes.js.map +1 -1
- package/dist/cjs/router/getRoutes.native.js.map +1 -1
- package/dist/cjs/router/linkingConfig.js.map +1 -1
- package/dist/cjs/router/linkingConfig.native.js.map +1 -1
- package/dist/cjs/router/matchers.cjs +1 -1
- package/dist/cjs/router/matchers.js +1 -1
- package/dist/cjs/router/matchers.js.map +1 -1
- package/dist/cjs/router/matchers.native.js +1 -1
- package/dist/cjs/router/matchers.native.js.map +1 -1
- package/dist/cjs/router/matchers.test.js +6 -2
- package/dist/cjs/router/matchers.test.js.map +1 -1
- package/dist/cjs/router/matchers.test.native.js.map +1 -1
- package/dist/cjs/router/router.js +13 -3
- package/dist/cjs/router/router.js.map +1 -1
- package/dist/cjs/router/router.native.js.map +1 -1
- package/dist/cjs/router/useNavigation.js.map +1 -1
- package/dist/cjs/router/useNavigation.native.js.map +1 -1
- package/dist/cjs/router/useScreens.cjs +73 -51
- package/dist/cjs/router/useScreens.js +72 -45
- package/dist/cjs/router/useScreens.js.map +1 -1
- package/dist/cjs/router/useScreens.native.js +30 -19
- package/dist/cjs/router/useScreens.native.js.map +1 -1
- package/dist/cjs/router/useViteRoutes.cjs +26 -8
- package/dist/cjs/router/useViteRoutes.js +28 -9
- package/dist/cjs/router/useViteRoutes.js.map +1 -1
- package/dist/cjs/router/useViteRoutes.native.js +33 -13
- package/dist/cjs/router/useViteRoutes.native.js.map +1 -1
- package/dist/cjs/router/utils/getNavigateAction.js.map +1 -1
- package/dist/cjs/router/utils/getNavigateAction.native.js.map +1 -1
- package/dist/cjs/server/createRoutesManifest.js.map +1 -1
- package/dist/cjs/server/createRoutesManifest.native.js.map +1 -1
- package/dist/cjs/server/getServerManifest.js +3 -1
- package/dist/cjs/server/getServerManifest.js.map +1 -1
- package/dist/cjs/server/getServerManifest.native.js.map +1 -1
- package/dist/cjs/server/oneServe.js +9 -2
- package/dist/cjs/server/oneServe.js.map +1 -1
- package/dist/cjs/server/oneServe.native.js.map +1 -1
- package/dist/cjs/server/setupBuildOptions.js.map +1 -1
- package/dist/cjs/server/setupBuildOptions.native.js.map +1 -1
- package/dist/cjs/server/staticHtmlFetcher.js.map +1 -1
- package/dist/cjs/server/staticHtmlFetcher.native.js.map +1 -1
- package/dist/cjs/server-render.js.map +1 -1
- package/dist/cjs/server-render.native.js.map +1 -1
- package/dist/cjs/typed-routes/getTypedRoutesDeclarationFile.js +14 -2
- package/dist/cjs/typed-routes/getTypedRoutesDeclarationFile.js.map +1 -1
- package/dist/cjs/typed-routes/getTypedRoutesDeclarationFile.native.js.map +1 -1
- package/dist/cjs/typed-routes/injectRouteHelpers.js +4 -1
- package/dist/cjs/typed-routes/injectRouteHelpers.js.map +1 -1
- package/dist/cjs/typed-routes/injectRouteHelpers.native.js.map +1 -1
- package/dist/cjs/ui/Slot.js.map +1 -1
- package/dist/cjs/ui/Slot.native.js.map +1 -1
- package/dist/cjs/ui/TabContext.js +3 -1
- package/dist/cjs/ui/TabContext.js.map +1 -1
- package/dist/cjs/ui/TabContext.native.js.map +1 -1
- package/dist/cjs/ui/TabRouter.js.map +1 -1
- package/dist/cjs/ui/TabRouter.native.js.map +1 -1
- package/dist/cjs/ui/TabTrigger.js +17 -2
- package/dist/cjs/ui/TabTrigger.js.map +1 -1
- package/dist/cjs/ui/TabTrigger.native.js.map +1 -1
- package/dist/cjs/ui/Tabs.js +5 -1
- package/dist/cjs/ui/Tabs.js.map +1 -1
- package/dist/cjs/ui/Tabs.native.js.map +1 -1
- package/dist/cjs/ui/common.js +3 -1
- package/dist/cjs/ui/common.js.map +1 -1
- package/dist/cjs/ui/common.native.js.map +1 -1
- package/dist/cjs/useLoader.js +4 -1
- package/dist/cjs/useLoader.js.map +1 -1
- package/dist/cjs/useLoader.native.js.map +1 -1
- package/dist/cjs/utils/cleanUrl.js.map +1 -1
- package/dist/cjs/utils/cleanUrl.native.js.map +1 -1
- package/dist/cjs/utils/url.js +3 -1
- package/dist/cjs/utils/url.js.map +1 -1
- package/dist/cjs/utils/url.native.js.map +1 -1
- package/dist/cjs/vercel/build/buildVercelOutputDirectory.js +29 -10
- package/dist/cjs/vercel/build/buildVercelOutputDirectory.js.map +1 -1
- package/dist/cjs/vercel/build/buildVercelOutputDirectory.native.js.map +1 -1
- package/dist/cjs/vercel/build/generate/createApiServerlessFunction.js +11 -3
- package/dist/cjs/vercel/build/generate/createApiServerlessFunction.js.map +1 -1
- package/dist/cjs/vercel/build/generate/createApiServerlessFunction.native.js.map +1 -1
- package/dist/cjs/vercel/build/generate/createSsrServerlessFunction.js +9 -2
- package/dist/cjs/vercel/build/generate/createSsrServerlessFunction.js.map +1 -1
- package/dist/cjs/vercel/build/generate/createSsrServerlessFunction.native.js.map +1 -1
- package/dist/cjs/vercel/build/getPathFromRoute.js +4 -1
- package/dist/cjs/vercel/build/getPathFromRoute.js.map +1 -1
- package/dist/cjs/vercel/build/getPathFromRoute.native.js.map +1 -1
- package/dist/cjs/views/Navigator.js +16 -8
- package/dist/cjs/views/Navigator.js.map +1 -1
- package/dist/cjs/views/Navigator.native.js.map +1 -1
- package/dist/cjs/views/RootErrorBoundary.js +4 -2
- package/dist/cjs/views/RootErrorBoundary.js.map +1 -1
- package/dist/cjs/views/RootErrorBoundary.native.js.map +1 -1
- package/dist/cjs/views/Screen.js +4 -1
- package/dist/cjs/views/Screen.js.map +1 -1
- package/dist/cjs/views/Screen.native.js.map +1 -1
- package/dist/cjs/vite/DevHead.cjs +14 -0
- package/dist/cjs/vite/DevHead.js +18 -0
- package/dist/cjs/vite/DevHead.js.map +1 -1
- package/dist/cjs/vite/loadConfig.js +6 -2
- package/dist/cjs/vite/loadConfig.js.map +1 -1
- package/dist/cjs/vite/loadConfig.native.js.map +1 -1
- package/dist/cjs/vite/one-server-only.js +3 -1
- package/dist/cjs/vite/one-server-only.js.map +1 -1
- package/dist/cjs/vite/one.cjs +9 -2
- package/dist/cjs/vite/one.js +18 -5
- package/dist/cjs/vite/one.js.map +1 -1
- package/dist/cjs/vite/one.native.js +17 -12
- package/dist/cjs/vite/one.native.js.map +1 -1
- package/dist/cjs/vite/plugins/SSRCSSPlugin.js +5 -1
- package/dist/cjs/vite/plugins/SSRCSSPlugin.js.map +1 -1
- package/dist/cjs/vite/plugins/SSRCSSPlugin.native.js.map +1 -1
- package/dist/cjs/vite/plugins/clientTreeShakePlugin.js +8 -2
- package/dist/cjs/vite/plugins/clientTreeShakePlugin.js.map +1 -1
- package/dist/cjs/vite/plugins/clientTreeShakePlugin.native.js.map +1 -1
- package/dist/cjs/vite/plugins/fileSystemRouterPlugin.cjs +1 -1
- package/dist/cjs/vite/plugins/fileSystemRouterPlugin.js +12 -5
- package/dist/cjs/vite/plugins/fileSystemRouterPlugin.js.map +1 -1
- package/dist/cjs/vite/plugins/fileSystemRouterPlugin.native.js +4 -1
- package/dist/cjs/vite/plugins/fileSystemRouterPlugin.native.js.map +1 -1
- package/dist/cjs/vite/plugins/generateFileSystemRouteTypesPlugin.cjs +1 -1
- package/dist/cjs/vite/plugins/generateFileSystemRouteTypesPlugin.js +1 -1
- package/dist/cjs/vite/plugins/generateFileSystemRouteTypesPlugin.js.map +1 -1
- package/dist/cjs/vite/plugins/generateFileSystemRouteTypesPlugin.native.js +6 -3
- package/dist/cjs/vite/plugins/generateFileSystemRouteTypesPlugin.native.js.map +1 -1
- package/dist/cjs/vite/plugins/removeReactNativeWebAnimatedPlugin.js.map +1 -1
- package/dist/cjs/vite/plugins/removeReactNativeWebAnimatedPlugin.native.js.map +1 -1
- package/dist/cjs/vite/plugins/virtualEntryPlugin.js +13 -3
- package/dist/cjs/vite/plugins/virtualEntryPlugin.js.map +1 -1
- package/dist/cjs/vite/plugins/virtualEntryPlugin.native.js.map +1 -1
- package/dist/cjs/vite/replaceLoader.js +4 -1
- package/dist/cjs/vite/replaceLoader.js.map +1 -1
- package/dist/cjs/vite/replaceLoader.native.js.map +1 -1
- package/dist/cjs/vite/resolveResponse.js.map +1 -1
- package/dist/cjs/vite/resolveResponse.native.js.map +1 -1
- package/dist/cjs/zero/subscribeToQuery.js.map +1 -1
- package/dist/cjs/zero/subscribeToQuery.native.js.map +1 -1
- package/dist/cjs/zero/useQueryZero.js +3 -1
- package/dist/cjs/zero/useQueryZero.js.map +1 -1
- package/dist/cjs/zero/useQueryZero.native.js.map +1 -1
- package/dist/esm/Root.js +6 -1
- package/dist/esm/Root.js.map +1 -1
- package/dist/esm/Root.mjs.map +1 -1
- package/dist/esm/Root.native.js.map +1 -1
- package/dist/esm/babel-plugins/one-router-metro.js +4 -1
- package/dist/esm/babel-plugins/one-router-metro.js.map +1 -1
- package/dist/esm/babel-plugins/one-router-metro.mjs.map +1 -1
- package/dist/esm/babel-plugins/one-router-metro.native.js.map +1 -1
- package/dist/esm/babel-plugins/remove-server-code.js +7 -2
- package/dist/esm/babel-plugins/remove-server-code.js.map +1 -1
- package/dist/esm/babel-plugins/remove-server-code.mjs.map +1 -1
- package/dist/esm/babel-plugins/remove-server-code.native.js.map +1 -1
- package/dist/esm/cli/build.js +31 -8
- package/dist/esm/cli/build.js.map +1 -1
- package/dist/esm/cli/build.mjs.map +1 -1
- package/dist/esm/cli/build.native.js.map +1 -1
- package/dist/esm/cli/buildPage.js +14 -4
- package/dist/esm/cli/buildPage.js.map +1 -1
- package/dist/esm/cli/buildPage.mjs.map +1 -1
- package/dist/esm/cli/buildPage.native.js.map +1 -1
- package/dist/esm/cli/generateRoutes.js +3 -1
- package/dist/esm/cli/generateRoutes.js.map +1 -1
- package/dist/esm/cli/generateRoutes.mjs.map +1 -1
- package/dist/esm/cli/generateRoutes.native.js.map +1 -1
- package/dist/esm/cli/generateSitemap.js.map +1 -1
- package/dist/esm/cli/generateSitemap.mjs.map +1 -1
- package/dist/esm/cli/generateSitemap.native.js.map +1 -1
- package/dist/esm/cli/generateSitemap.test.js +14 -4
- package/dist/esm/cli/generateSitemap.test.js.map +1 -1
- package/dist/esm/cli/generateSitemap.test.mjs.map +1 -1
- package/dist/esm/cli/generateSitemap.test.native.js.map +1 -1
- package/dist/esm/cli/main.js +4 -2
- package/dist/esm/cli/main.js.map +1 -1
- package/dist/esm/cli/main.mjs.map +1 -1
- package/dist/esm/cli/main.native.js.map +1 -1
- package/dist/esm/cli/prebuild.js.map +1 -1
- package/dist/esm/cli/prebuild.mjs.map +1 -1
- package/dist/esm/cli/prebuild.native.js.map +1 -1
- package/dist/esm/clientLoaderResolver.js.map +1 -1
- package/dist/esm/clientLoaderResolver.mjs.map +1 -1
- package/dist/esm/clientLoaderResolver.native.js.map +1 -1
- package/dist/esm/config.js +3 -1
- package/dist/esm/config.js.map +1 -1
- package/dist/esm/config.mjs.map +1 -1
- package/dist/esm/config.native.js.map +1 -1
- package/dist/esm/constants.js.map +1 -1
- package/dist/esm/constants.mjs.map +1 -1
- package/dist/esm/constants.native.js.map +1 -1
- package/dist/esm/createApp.js +9 -1
- package/dist/esm/createApp.js.map +1 -1
- package/dist/esm/createApp.mjs.map +1 -1
- package/dist/esm/createHandleRequest.js +9 -3
- package/dist/esm/createHandleRequest.js.map +1 -1
- package/dist/esm/createHandleRequest.mjs.map +1 -1
- package/dist/esm/createHandleRequest.native.js.map +1 -1
- package/dist/esm/fork/__tests__/getPathFromState.test.js +90 -88
- package/dist/esm/fork/__tests__/getPathFromState.test.js.map +1 -1
- package/dist/esm/fork/__tests__/getPathFromState.test.mjs.map +1 -1
- package/dist/esm/fork/__tests__/getPathFromState.test.native.js.map +1 -1
- package/dist/esm/fork/__tests__/getStateFromPath.test.js +163 -86
- package/dist/esm/fork/__tests__/getStateFromPath.test.js.map +1 -1
- package/dist/esm/fork/__tests__/getStateFromPath.test.mjs.map +1 -1
- package/dist/esm/fork/__tests__/getStateFromPath.test.native.js.map +1 -1
- package/dist/esm/fork/_shared.js.map +1 -1
- package/dist/esm/fork/_shared.mjs.map +1 -1
- package/dist/esm/fork/_shared.native.js.map +1 -1
- package/dist/esm/fork/extractPathFromURL.js.map +1 -1
- package/dist/esm/fork/extractPathFromURL.mjs.map +1 -1
- package/dist/esm/fork/extractPathFromURL.native.js.map +1 -1
- package/dist/esm/fork/getPathFromState-mods.js +4 -1
- package/dist/esm/fork/getPathFromState-mods.js.map +1 -1
- package/dist/esm/fork/getPathFromState-mods.mjs.map +1 -1
- package/dist/esm/fork/getPathFromState-mods.native.js.map +1 -1
- package/dist/esm/fork/getPathFromState.js +3 -1
- package/dist/esm/fork/getPathFromState.js.map +1 -1
- package/dist/esm/fork/getPathFromState.mjs.map +1 -1
- package/dist/esm/fork/getPathFromState.native.js.map +1 -1
- package/dist/esm/fork/getStateFromPath-mods.js.map +1 -1
- package/dist/esm/fork/getStateFromPath-mods.mjs.map +1 -1
- package/dist/esm/fork/getStateFromPath-mods.native.js.map +1 -1
- package/dist/esm/fork/getStateFromPath.js +7 -1
- package/dist/esm/fork/getStateFromPath.js.map +1 -1
- package/dist/esm/fork/getStateFromPath.mjs.map +1 -1
- package/dist/esm/fork/getStateFromPath.native.js.map +1 -1
- package/dist/esm/fork/getStateFromPath.test.js +25 -9
- package/dist/esm/fork/getStateFromPath.test.js.map +1 -1
- package/dist/esm/fork/getStateFromPath.test.mjs.map +1 -1
- package/dist/esm/fork/getStateFromPath.test.native.js.map +1 -1
- package/dist/esm/fork/useBackButton.js.map +1 -1
- package/dist/esm/fork/useBackButton.mjs.map +1 -1
- package/dist/esm/fork/useDocumentTitle.js +4 -1
- package/dist/esm/fork/useDocumentTitle.js.map +1 -1
- package/dist/esm/fork/useDocumentTitle.mjs.map +1 -1
- package/dist/esm/fork/useLinking.js +4 -1
- package/dist/esm/fork/useLinking.js.map +1 -1
- package/dist/esm/fork/useLinking.mjs.map +1 -1
- package/dist/esm/fork/validatePathConfig.js.map +1 -1
- package/dist/esm/fork/validatePathConfig.mjs.map +1 -1
- package/dist/esm/fork/validatePathConfig.native.js.map +1 -1
- package/dist/esm/hooks.js.map +1 -1
- package/dist/esm/hooks.mjs.map +1 -1
- package/dist/esm/hooks.native.js.map +1 -1
- package/dist/esm/index.js +3 -1
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/layouts/Tabs.js.map +1 -1
- package/dist/esm/layouts/Tabs.mjs.map +1 -1
- package/dist/esm/layouts/Tabs.native.js.map +1 -1
- package/dist/esm/layouts/withLayoutContext.js +10 -8
- package/dist/esm/layouts/withLayoutContext.js.map +1 -1
- package/dist/esm/layouts/withLayoutContext.mjs.map +1 -1
- package/dist/esm/layouts/withLayoutContext.native.js.map +1 -1
- package/dist/esm/link/Link.js.map +1 -1
- package/dist/esm/link/Link.mjs.map +1 -1
- package/dist/esm/link/Link.native.js.map +1 -1
- package/dist/esm/link/linking.js +3 -1
- package/dist/esm/link/linking.js.map +1 -1
- package/dist/esm/link/linking.mjs.map +1 -1
- package/dist/esm/link/linking.native.js.map +1 -1
- package/dist/esm/link/useLinkTo.js.map +1 -1
- package/dist/esm/link/useLinkTo.mjs.map +1 -1
- package/dist/esm/link/useLinkTo.native.js.map +1 -1
- package/dist/esm/link/useLoadedNavigation.js +3 -1
- package/dist/esm/link/useLoadedNavigation.js.map +1 -1
- package/dist/esm/link/useLoadedNavigation.mjs.map +1 -1
- package/dist/esm/link/useLoadedNavigation.native.js.map +1 -1
- package/dist/esm/metro-config/getViteMetroPluginOptions.js +8 -10
- package/dist/esm/metro-config/getViteMetroPluginOptions.js.map +1 -1
- package/dist/esm/metro-config/getViteMetroPluginOptions.mjs +6 -8
- package/dist/esm/metro-config/getViteMetroPluginOptions.mjs.map +1 -1
- package/dist/esm/metro-config/getViteMetroPluginOptions.native.js +9 -11
- package/dist/esm/metro-config/getViteMetroPluginOptions.native.js.map +1 -1
- package/dist/esm/router/Route.js.map +1 -1
- package/dist/esm/router/Route.mjs.map +1 -1
- package/dist/esm/router/Route.native.js.map +1 -1
- package/dist/esm/router/RouteInfoContext.js +7 -1
- package/dist/esm/router/RouteInfoContext.js.map +1 -1
- package/dist/esm/router/RouteInfoContext.mjs.map +1 -1
- package/dist/esm/router/RouteInfoContext.native.js.map +1 -1
- package/dist/esm/router/filterRootHTML.js.map +1 -1
- package/dist/esm/router/filterRootHTML.mjs.map +1 -1
- package/dist/esm/router/filterRootHTML.native.js.map +1 -1
- package/dist/esm/router/getLinkingConfig.js.map +1 -1
- package/dist/esm/router/getLinkingConfig.mjs.map +1 -1
- package/dist/esm/router/getLinkingConfig.native.js.map +1 -1
- package/dist/esm/router/getNormalizedStatePath.js.map +1 -1
- package/dist/esm/router/getNormalizedStatePath.mjs.map +1 -1
- package/dist/esm/router/getNormalizedStatePath.native.js.map +1 -1
- package/dist/esm/router/getRoutes.js +3 -1
- package/dist/esm/router/getRoutes.js.map +1 -1
- package/dist/esm/router/getRoutes.mjs.map +1 -1
- package/dist/esm/router/getRoutes.native.js.map +1 -1
- package/dist/esm/router/linkingConfig.js +3 -1
- package/dist/esm/router/linkingConfig.js.map +1 -1
- package/dist/esm/router/linkingConfig.mjs.map +1 -1
- package/dist/esm/router/linkingConfig.native.js.map +1 -1
- package/dist/esm/router/matchers.js +1 -1
- package/dist/esm/router/matchers.js.map +1 -1
- package/dist/esm/router/matchers.mjs +1 -1
- package/dist/esm/router/matchers.mjs.map +1 -1
- package/dist/esm/router/matchers.native.js +1 -1
- package/dist/esm/router/matchers.native.js.map +1 -1
- package/dist/esm/router/matchers.test.js +6 -2
- package/dist/esm/router/matchers.test.js.map +1 -1
- package/dist/esm/router/matchers.test.mjs.map +1 -1
- package/dist/esm/router/router.js +16 -4
- package/dist/esm/router/router.js.map +1 -1
- package/dist/esm/router/router.mjs.map +1 -1
- package/dist/esm/router/router.native.js.map +1 -1
- package/dist/esm/router/useNavigation.js.map +1 -1
- package/dist/esm/router/useNavigation.mjs.map +1 -1
- package/dist/esm/router/useNavigation.native.js.map +1 -1
- package/dist/esm/router/useScreens.js +73 -46
- package/dist/esm/router/useScreens.js.map +1 -1
- package/dist/esm/router/useScreens.mjs +74 -52
- package/dist/esm/router/useScreens.mjs.map +1 -1
- package/dist/esm/router/useScreens.native.js +30 -19
- package/dist/esm/router/useScreens.native.js.map +1 -1
- package/dist/esm/router/useViteRoutes.js +28 -9
- package/dist/esm/router/useViteRoutes.js.map +1 -1
- package/dist/esm/router/useViteRoutes.mjs +26 -8
- package/dist/esm/router/useViteRoutes.mjs.map +1 -1
- package/dist/esm/router/useViteRoutes.native.js +33 -13
- package/dist/esm/router/useViteRoutes.native.js.map +1 -1
- package/dist/esm/router/utils/getNavigateAction.js.map +1 -1
- package/dist/esm/router/utils/getNavigateAction.mjs.map +1 -1
- package/dist/esm/router/utils/getNavigateAction.native.js.map +1 -1
- package/dist/esm/server/createRoutesManifest.js.map +1 -1
- package/dist/esm/server/createRoutesManifest.mjs.map +1 -1
- package/dist/esm/server/createRoutesManifest.native.js.map +1 -1
- package/dist/esm/server/getServerManifest.js +3 -1
- package/dist/esm/server/getServerManifest.js.map +1 -1
- package/dist/esm/server/getServerManifest.mjs.map +1 -1
- package/dist/esm/server/getServerManifest.native.js.map +1 -1
- package/dist/esm/server/oneServe.js +9 -2
- package/dist/esm/server/oneServe.js.map +1 -1
- package/dist/esm/server/oneServe.mjs.map +1 -1
- package/dist/esm/server/oneServe.native.js.map +1 -1
- package/dist/esm/server/setupBuildOptions.js.map +1 -1
- package/dist/esm/server/setupBuildOptions.mjs.map +1 -1
- package/dist/esm/server/setupBuildOptions.native.js.map +1 -1
- package/dist/esm/server/staticHtmlFetcher.js.map +1 -1
- package/dist/esm/server/staticHtmlFetcher.mjs.map +1 -1
- package/dist/esm/server/staticHtmlFetcher.native.js.map +1 -1
- package/dist/esm/server-render.js.map +1 -1
- package/dist/esm/server-render.mjs.map +1 -1
- package/dist/esm/server-render.native.js.map +1 -1
- package/dist/esm/typed-routes/getTypedRoutesDeclarationFile.js +14 -2
- package/dist/esm/typed-routes/getTypedRoutesDeclarationFile.js.map +1 -1
- package/dist/esm/typed-routes/getTypedRoutesDeclarationFile.mjs.map +1 -1
- package/dist/esm/typed-routes/getTypedRoutesDeclarationFile.native.js.map +1 -1
- package/dist/esm/typed-routes/injectRouteHelpers.js +4 -1
- package/dist/esm/typed-routes/injectRouteHelpers.js.map +1 -1
- package/dist/esm/typed-routes/injectRouteHelpers.mjs.map +1 -1
- package/dist/esm/typed-routes/injectRouteHelpers.native.js.map +1 -1
- package/dist/esm/ui/Slot.js.map +1 -1
- package/dist/esm/ui/Slot.mjs.map +1 -1
- package/dist/esm/ui/Slot.native.js.map +1 -1
- package/dist/esm/ui/TabContext.js +3 -1
- package/dist/esm/ui/TabContext.js.map +1 -1
- package/dist/esm/ui/TabContext.mjs.map +1 -1
- package/dist/esm/ui/TabContext.native.js.map +1 -1
- package/dist/esm/ui/TabRouter.js.map +1 -1
- package/dist/esm/ui/TabRouter.mjs.map +1 -1
- package/dist/esm/ui/TabRouter.native.js.map +1 -1
- package/dist/esm/ui/TabTrigger.js +21 -3
- package/dist/esm/ui/TabTrigger.js.map +1 -1
- package/dist/esm/ui/TabTrigger.mjs.map +1 -1
- package/dist/esm/ui/TabTrigger.native.js.map +1 -1
- package/dist/esm/ui/Tabs.js +5 -1
- package/dist/esm/ui/Tabs.js.map +1 -1
- package/dist/esm/ui/Tabs.mjs.map +1 -1
- package/dist/esm/ui/Tabs.native.js.map +1 -1
- package/dist/esm/ui/common.js +8 -2
- package/dist/esm/ui/common.js.map +1 -1
- package/dist/esm/ui/common.mjs.map +1 -1
- package/dist/esm/ui/common.native.js.map +1 -1
- package/dist/esm/useLoader.js +4 -1
- package/dist/esm/useLoader.js.map +1 -1
- package/dist/esm/useLoader.mjs.map +1 -1
- package/dist/esm/useLoader.native.js.map +1 -1
- package/dist/esm/utils/cleanUrl.js.map +1 -1
- package/dist/esm/utils/cleanUrl.mjs.map +1 -1
- package/dist/esm/utils/cleanUrl.native.js.map +1 -1
- package/dist/esm/utils/url.js +3 -1
- package/dist/esm/utils/url.js.map +1 -1
- package/dist/esm/utils/url.mjs.map +1 -1
- package/dist/esm/utils/url.native.js.map +1 -1
- package/dist/esm/vercel/build/buildVercelOutputDirectory.js +29 -10
- package/dist/esm/vercel/build/buildVercelOutputDirectory.js.map +1 -1
- package/dist/esm/vercel/build/buildVercelOutputDirectory.mjs.map +1 -1
- package/dist/esm/vercel/build/buildVercelOutputDirectory.native.js.map +1 -1
- package/dist/esm/vercel/build/generate/createApiServerlessFunction.js +11 -3
- package/dist/esm/vercel/build/generate/createApiServerlessFunction.js.map +1 -1
- package/dist/esm/vercel/build/generate/createApiServerlessFunction.mjs.map +1 -1
- package/dist/esm/vercel/build/generate/createApiServerlessFunction.native.js.map +1 -1
- package/dist/esm/vercel/build/generate/createSsrServerlessFunction.js +9 -2
- package/dist/esm/vercel/build/generate/createSsrServerlessFunction.js.map +1 -1
- package/dist/esm/vercel/build/generate/createSsrServerlessFunction.mjs.map +1 -1
- package/dist/esm/vercel/build/generate/createSsrServerlessFunction.native.js.map +1 -1
- package/dist/esm/vercel/build/getPathFromRoute.js +4 -1
- package/dist/esm/vercel/build/getPathFromRoute.js.map +1 -1
- package/dist/esm/vercel/build/getPathFromRoute.mjs.map +1 -1
- package/dist/esm/vercel/build/getPathFromRoute.native.js.map +1 -1
- package/dist/esm/views/Navigator.js +20 -9
- package/dist/esm/views/Navigator.js.map +1 -1
- package/dist/esm/views/Navigator.mjs.map +1 -1
- package/dist/esm/views/Navigator.native.js.map +1 -1
- package/dist/esm/views/RootErrorBoundary.js +4 -2
- package/dist/esm/views/RootErrorBoundary.js.map +1 -1
- package/dist/esm/views/RootErrorBoundary.mjs.map +1 -1
- package/dist/esm/views/RootErrorBoundary.native.js.map +1 -1
- package/dist/esm/views/Screen.js +4 -1
- package/dist/esm/views/Screen.js.map +1 -1
- package/dist/esm/views/Screen.mjs.map +1 -1
- package/dist/esm/views/Screen.native.js.map +1 -1
- package/dist/esm/vite/DevHead.js +18 -0
- package/dist/esm/vite/DevHead.js.map +1 -1
- package/dist/esm/vite/DevHead.mjs +14 -0
- package/dist/esm/vite/DevHead.mjs.map +1 -1
- package/dist/esm/vite/loadConfig.js +6 -2
- package/dist/esm/vite/loadConfig.js.map +1 -1
- package/dist/esm/vite/loadConfig.mjs.map +1 -1
- package/dist/esm/vite/loadConfig.native.js.map +1 -1
- package/dist/esm/vite/one-server-only.js +3 -1
- package/dist/esm/vite/one-server-only.js.map +1 -1
- package/dist/esm/vite/one-server-only.mjs.map +1 -1
- package/dist/esm/vite/one.js +18 -5
- package/dist/esm/vite/one.js.map +1 -1
- package/dist/esm/vite/one.mjs +9 -2
- package/dist/esm/vite/one.mjs.map +1 -1
- package/dist/esm/vite/one.native.js +17 -12
- package/dist/esm/vite/one.native.js.map +1 -1
- package/dist/esm/vite/plugins/SSRCSSPlugin.js +5 -1
- package/dist/esm/vite/plugins/SSRCSSPlugin.js.map +1 -1
- package/dist/esm/vite/plugins/SSRCSSPlugin.mjs.map +1 -1
- package/dist/esm/vite/plugins/SSRCSSPlugin.native.js.map +1 -1
- package/dist/esm/vite/plugins/clientTreeShakePlugin.js +12 -3
- package/dist/esm/vite/plugins/clientTreeShakePlugin.js.map +1 -1
- package/dist/esm/vite/plugins/clientTreeShakePlugin.mjs.map +1 -1
- package/dist/esm/vite/plugins/clientTreeShakePlugin.native.js.map +1 -1
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.js +13 -6
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.js.map +1 -1
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.mjs +2 -2
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.mjs.map +1 -1
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.native.js +5 -2
- package/dist/esm/vite/plugins/fileSystemRouterPlugin.native.js.map +1 -1
- package/dist/esm/vite/plugins/generateFileSystemRouteTypesPlugin.js +2 -2
- package/dist/esm/vite/plugins/generateFileSystemRouteTypesPlugin.js.map +1 -1
- package/dist/esm/vite/plugins/generateFileSystemRouteTypesPlugin.mjs +2 -2
- package/dist/esm/vite/plugins/generateFileSystemRouteTypesPlugin.mjs.map +1 -1
- package/dist/esm/vite/plugins/generateFileSystemRouteTypesPlugin.native.js +7 -4
- package/dist/esm/vite/plugins/generateFileSystemRouteTypesPlugin.native.js.map +1 -1
- package/dist/esm/vite/plugins/removeReactNativeWebAnimatedPlugin.js.map +1 -1
- package/dist/esm/vite/plugins/removeReactNativeWebAnimatedPlugin.mjs.map +1 -1
- package/dist/esm/vite/plugins/removeReactNativeWebAnimatedPlugin.native.js.map +1 -1
- package/dist/esm/vite/plugins/virtualEntryPlugin.js +13 -3
- package/dist/esm/vite/plugins/virtualEntryPlugin.js.map +1 -1
- package/dist/esm/vite/plugins/virtualEntryPlugin.mjs.map +1 -1
- package/dist/esm/vite/plugins/virtualEntryPlugin.native.js.map +1 -1
- package/dist/esm/vite/replaceLoader.js +4 -1
- package/dist/esm/vite/replaceLoader.js.map +1 -1
- package/dist/esm/vite/replaceLoader.mjs.map +1 -1
- package/dist/esm/vite/replaceLoader.native.js.map +1 -1
- package/dist/esm/vite/resolveResponse.js +5 -1
- package/dist/esm/vite/resolveResponse.js.map +1 -1
- package/dist/esm/vite/resolveResponse.mjs.map +1 -1
- package/dist/esm/vite/resolveResponse.native.js.map +1 -1
- package/dist/esm/zero/subscribeToQuery.js.map +1 -1
- package/dist/esm/zero/subscribeToQuery.mjs.map +1 -1
- package/dist/esm/zero/subscribeToQuery.native.js.map +1 -1
- package/dist/esm/zero/useQueryZero.js +3 -1
- package/dist/esm/zero/useQueryZero.js.map +1 -1
- package/dist/esm/zero/useQueryZero.mjs.map +1 -1
- package/dist/esm/zero/useQueryZero.native.js.map +1 -1
- package/metro-entry-ctx.js +2 -1
- package/package.json +10 -10
- package/src/Root.tsx +14 -5
- package/src/babel-plugins/one-router-metro.ts +4 -1
- package/src/babel-plugins/remove-server-code.ts +15 -4
- package/src/cli/build.ts +33 -8
- package/src/cli/buildPage.ts +15 -4
- package/src/cli/generateRoutes.ts +3 -1
- package/src/cli/generateSitemap.test.ts +14 -4
- package/src/cli/generateSitemap.ts +7 -2
- package/src/cli/main.ts +3 -1
- package/src/cli/prebuild.ts +5 -1
- package/src/clientLoaderResolver.ts +4 -1
- package/src/config.ts +6 -2
- package/src/constants.ts +4 -2
- package/src/createApp.tsx +11 -3
- package/src/createHandleRequest.ts +17 -6
- package/src/fork/__tests__/getPathFromState.test.tsx +128 -107
- package/src/fork/__tests__/getStateFromPath.test.tsx +181 -95
- package/src/fork/_shared.ts +2 -1
- package/src/fork/extractPathFromURL.ts +2 -1
- package/src/fork/getPathFromState-mods.ts +8 -2
- package/src/fork/getPathFromState.ts +16 -5
- package/src/fork/getStateFromPath-mods.ts +13 -3
- package/src/fork/getStateFromPath.test.ts +25 -9
- package/src/fork/getStateFromPath.ts +21 -5
- package/src/fork/useBackButton.native.tsx +3 -1
- package/src/fork/useBackButton.tsx +3 -1
- package/src/fork/useDocumentTitle.tsx +4 -1
- package/src/fork/useLinking.native.ts +3 -1
- package/src/fork/useLinking.ts +9 -3
- package/src/fork/validatePathConfig.ts +6 -1
- package/src/head/Head.ios.tsx +3 -1
- package/src/hooks.tsx +4 -2
- package/src/index.ts +4 -1
- package/src/interfaces/router.ts +29 -13
- package/src/layouts/Tabs.tsx +5 -1
- package/src/layouts/withLayoutContext.tsx +24 -21
- package/src/link/Link.tsx +3 -1
- package/src/link/linking.ts +3 -1
- package/src/link/useLinkTo.tsx +3 -1
- package/src/link/useLoadedNavigation.ts +5 -1
- package/src/metro-config/getViteMetroPluginOptions.ts +20 -22
- package/src/router/Route.tsx +3 -1
- package/src/router/RouteInfoContext.tsx +3 -1
- package/src/router/filterRootHTML.ts +5 -1
- package/src/router/getLinkingConfig.ts +4 -1
- package/src/router/getNormalizedStatePath.tsx +4 -1
- package/src/router/getRoutes.ts +13 -4
- package/src/router/linkingConfig.ts +4 -1
- package/src/router/matchers.test.ts +6 -2
- package/src/router/matchers.ts +1 -1
- package/src/router/router.ts +25 -6
- package/src/router/useNavigation.ts +4 -1
- package/src/router/useScreens.tsx +127 -64
- package/src/router/useViteRoutes.tsx +44 -2
- package/src/router/utils/getNavigateAction.ts +4 -2
- package/src/server/createRoutesManifest.ts +4 -1
- package/src/server/getServerManifest.ts +7 -2
- package/src/server/oneServe.ts +21 -8
- package/src/server/setupBuildOptions.ts +2 -1
- package/src/server/staticHtmlFetcher.ts +3 -1
- package/src/server-render.tsx +4 -1
- package/src/typed-routes/getTypedRoutesDeclarationFile.ts +20 -4
- package/src/typed-routes/injectRouteHelpers.ts +12 -3
- package/src/types.ts +2 -2
- package/src/ui/Slot.tsx +4 -2
- package/src/ui/TabContext.tsx +3 -1
- package/src/ui/TabRouter.tsx +7 -2
- package/src/ui/TabTrigger.tsx +20 -3
- package/src/ui/Tabs.tsx +8 -2
- package/src/ui/common.tsx +19 -5
- package/src/useLoader.ts +9 -4
- package/src/utils/cleanUrl.ts +5 -1
- package/src/utils/url.ts +3 -1
- package/src/vercel/build/buildVercelOutputDirectory.ts +31 -10
- package/src/vercel/build/generate/createApiServerlessFunction.ts +11 -3
- package/src/vercel/build/generate/createSsrServerlessFunction.ts +10 -3
- package/src/vercel/build/getPathFromRoute.ts +4 -1
- package/src/views/Navigator.tsx +21 -9
- package/src/views/RootErrorBoundary.tsx +3 -1
- package/src/views/Screen.tsx +4 -1
- package/src/vite/DevHead.tsx +15 -0
- package/src/vite/loadConfig.ts +6 -2
- package/src/vite/one-server-only.tsx +10 -4
- package/src/vite/one.ts +80 -47
- package/src/vite/plugins/SSRCSSPlugin.ts +9 -2
- package/src/vite/plugins/clientTreeShakePlugin.ts +22 -6
- package/src/vite/plugins/fileSystemRouterPlugin.tsx +14 -5
- package/src/vite/plugins/generateFileSystemRouteTypesPlugin.tsx +6 -3
- package/src/vite/plugins/removeReactNativeWebAnimatedPlugin.ts +3 -1
- package/src/vite/plugins/virtualEntryPlugin.ts +22 -5
- package/src/vite/replaceLoader.ts +7 -1
- package/src/vite/resolveResponse.ts +6 -2
- package/src/vite/types.ts +6 -3
- package/src/zero/subscribeToQuery.ts +4 -1
- package/src/zero/types.ts +8 -9
- package/src/zero/useQuery.ts +1 -1
- package/src/zero/useQueryZero.ts +3 -1
- package/types/Root.d.ts.map +1 -1
- package/types/babel-plugins/one-router-metro.d.ts.map +1 -1
- package/types/babel-plugins/remove-server-code.d.ts.map +1 -1
- package/types/cli/build.d.ts.map +1 -1
- package/types/cli/buildPage.d.ts.map +1 -1
- package/types/cli/generateRoutes.d.ts.map +1 -1
- package/types/cli/generateSitemap.d.ts.map +1 -1
- package/types/cli/main.d.ts.map +1 -1
- package/types/cli/prebuild.d.ts.map +1 -1
- package/types/clientLoaderResolver.d.ts.map +1 -1
- package/types/config.d.ts.map +1 -1
- package/types/constants.d.ts.map +1 -1
- package/types/createApp.d.ts.map +1 -1
- package/types/createHandleRequest.d.ts +1 -1
- package/types/createHandleRequest.d.ts.map +1 -1
- package/types/fork/_shared.d.ts.map +1 -1
- package/types/fork/extractPathFromURL.d.ts.map +1 -1
- package/types/fork/getPathFromState.d.ts.map +1 -1
- package/types/fork/getStateFromPath-mods.d.ts.map +1 -1
- package/types/fork/getStateFromPath.d.ts.map +1 -1
- package/types/fork/useBackButton.d.ts.map +1 -1
- package/types/fork/useBackButton.native.d.ts.map +1 -1
- package/types/fork/useDocumentTitle.d.ts.map +1 -1
- package/types/fork/useLinking.d.ts.map +1 -1
- package/types/fork/useLinking.native.d.ts.map +1 -1
- package/types/fork/validatePathConfig.d.ts.map +1 -1
- package/types/head/Head.ios.d.ts.map +1 -1
- package/types/hooks.d.ts +2 -2
- package/types/hooks.d.ts.map +1 -1
- package/types/index.d.ts +1 -1
- package/types/index.d.ts.map +1 -1
- package/types/interfaces/router.d.ts.map +1 -1
- package/types/layouts/Tabs.d.ts.map +1 -1
- package/types/layouts/withLayoutContext.d.ts.map +1 -1
- package/types/link/Link.d.ts.map +1 -1
- package/types/link/linking.d.ts.map +1 -1
- package/types/link/useLinkTo.d.ts.map +1 -1
- package/types/link/useLoadedNavigation.d.ts.map +1 -1
- package/types/metro-config/getViteMetroPluginOptions.d.ts.map +1 -1
- package/types/router/Route.d.ts.map +1 -1
- package/types/router/RouteInfoContext.d.ts.map +1 -1
- package/types/router/filterRootHTML.d.ts.map +1 -1
- package/types/router/getNormalizedStatePath.d.ts.map +1 -1
- package/types/router/getRoutes.d.ts.map +1 -1
- package/types/router/linkingConfig.d.ts.map +1 -1
- package/types/router/router.d.ts.map +1 -1
- package/types/router/useNavigation.d.ts.map +1 -1
- package/types/router/useScreens.d.ts.map +1 -1
- package/types/router/useViteRoutes.d.ts.map +1 -1
- package/types/router/utils/getNavigateAction.d.ts.map +1 -1
- package/types/server/createRoutesManifest.d.ts.map +1 -1
- package/types/server/getServerManifest.d.ts.map +1 -1
- package/types/server/oneServe.d.ts.map +1 -1
- package/types/server/setupBuildOptions.d.ts.map +1 -1
- package/types/server/staticHtmlFetcher.d.ts.map +1 -1
- package/types/server-render.d.ts.map +1 -1
- package/types/types.d.ts +2 -2
- package/types/ui/Slot.d.ts.map +1 -1
- package/types/ui/TabContext.d.ts.map +1 -1
- package/types/ui/TabRouter.d.ts.map +1 -1
- package/types/ui/TabTrigger.d.ts.map +1 -1
- package/types/ui/Tabs.d.ts.map +1 -1
- package/types/ui/common.d.ts.map +1 -1
- package/types/useLoader.d.ts.map +1 -1
- package/types/utils/cleanUrl.d.ts.map +1 -1
- package/types/utils/url.d.ts.map +1 -1
- package/types/vercel/build/buildVercelOutputDirectory.d.ts.map +1 -1
- package/types/vercel/build/generate/createApiServerlessFunction.d.ts.map +1 -1
- package/types/vercel/build/generate/createSsrServerlessFunction.d.ts.map +1 -1
- package/types/vercel/build/getPathFromRoute.d.ts.map +1 -1
- package/types/views/Navigator.d.ts +1 -1
- package/types/views/Navigator.d.ts.map +1 -1
- package/types/views/RootErrorBoundary.d.ts.map +1 -1
- package/types/views/Screen.d.ts +1 -1
- package/types/views/Screen.d.ts.map +1 -1
- package/types/vite/DevHead.d.ts.map +1 -1
- package/types/vite/loadConfig.d.ts.map +1 -1
- package/types/vite/one-server-only.d.ts +2 -2
- package/types/vite/one-server-only.d.ts.map +1 -1
- package/types/vite/one.d.ts.map +1 -1
- package/types/vite/plugins/SSRCSSPlugin.d.ts.map +1 -1
- package/types/vite/plugins/clientTreeShakePlugin.d.ts.map +1 -1
- package/types/vite/plugins/fileSystemRouterPlugin.d.ts.map +1 -1
- package/types/vite/plugins/generateFileSystemRouteTypesPlugin.d.ts.map +1 -1
- package/types/vite/plugins/removeReactNativeWebAnimatedPlugin.d.ts.map +1 -1
- package/types/vite/plugins/virtualEntryPlugin.d.ts.map +1 -1
- package/types/vite/replaceLoader.d.ts +2 -2
- package/types/vite/replaceLoader.d.ts.map +1 -1
- package/types/vite/resolveResponse.d.ts.map +1 -1
- package/types/vite/types.d.ts +1 -1
- package/types/vite/types.d.ts.map +1 -1
- package/types/zero/subscribeToQuery.d.ts.map +1 -1
- package/types/zero/types.d.ts.map +1 -1
- package/types/zero/useQueryZero.d.ts.map +1 -1
- package/vendor/react/cjs/react-jsx-dev-runtime.development.js +1230 -1078
- package/vendor/react/cjs/react-jsx-dev-runtime.production.min.js +4 -1
- package/vendor/react/cjs/react-jsx-dev-runtime.profiling.min.js +4 -1
- package/vendor/react/cjs/react-jsx-runtime.development.js +1244 -1092
- package/vendor/react/cjs/react-jsx-runtime.production.min.js +23 -2
- package/vendor/react/cjs/react-jsx-runtime.profiling.min.js +23 -2
- package/vendor/react/cjs/react.development.js +2604 -2324
- package/vendor/react/cjs/react.production.min.js +360 -17
- package/vendor/react/cjs/react.shared-subset.development.js +9 -7
- package/vendor/react/cjs/react.shared-subset.production.min.js +2 -1
- package/vendor/react/index.js +3 -3
- package/vendor/react/jsx-dev-runtime.js +3 -3
- package/vendor/react/jsx-runtime.js +3 -3
- package/vendor/react/react.shared-subset.js +3 -3
- package/vendor/react/umd/react.development.js +1430 -1152
- package/vendor/react/umd/react.production.min.js +657 -22
- package/vendor/react/umd/react.profiling.min.js +657 -22
- package/vendor/react-dom/cjs/react-dom-server-legacy.browser.development.js +7183 -5938
- package/vendor/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +1941 -84
- package/vendor/react-dom/cjs/react-dom-server-legacy.node.development.js +7239 -5986
- package/vendor/react-dom/cjs/react-dom-server-legacy.node.production.min.js +2055 -92
- package/vendor/react-dom/cjs/react-dom-server.browser.development.js +7146 -5924
- package/vendor/react-dom/cjs/react-dom-server.browser.production.min.js +1997 -87
- package/vendor/react-dom/cjs/react-dom-server.node.development.js +7210 -5976
- package/vendor/react-dom/cjs/react-dom-server.node.production.min.js +2075 -93
- package/vendor/react-dom/cjs/react-dom-test-utils.development.js +1700 -1487
- package/vendor/react-dom/cjs/react-dom-test-utils.production.min.js +653 -31
- package/vendor/react-dom/cjs/react-dom.development.js +29568 -25248
- package/vendor/react-dom/cjs/react-dom.production.min.js +8208 -310
- package/vendor/react-dom/cjs/react-dom.profiling.min.js +8750 -343
- package/vendor/react-dom/client.js +15 -15
- package/vendor/react-dom/index.js +8 -8
- package/vendor/react-dom/profiling.js +8 -8
- package/vendor/react-dom/server.browser.js +12 -12
- package/vendor/react-dom/server.js +2 -2
- package/vendor/react-dom/server.node.js +12 -12
- package/vendor/react-dom/test-utils.js +3 -3
- package/vendor/react-dom/umd/react-dom-server-legacy.browser.development.js +3735 -2502
- package/vendor/react-dom/umd/react-dom-server-legacy.browser.production.min.js +1964 -66
- package/vendor/react-dom/umd/react-dom-server.browser.development.js +3724 -2511
- package/vendor/react-dom/umd/react-dom-server.browser.production.min.js +2017 -67
- package/vendor/react-dom/umd/react-dom-test-utils.development.js +777 -563
- package/vendor/react-dom/umd/react-dom-test-utils.production.min.js +678 -24
- package/vendor/react-dom/umd/react-dom.development.js +15978 -11854
- package/vendor/react-dom/umd/react-dom.production.min.js +8328 -256
- package/vendor/react-dom/umd/react-dom.profiling.min.js +8868 -274
|
@@ -8,1308 +8,1460 @@
|
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
'use strict'
|
|
12
|
-
|
|
13
|
-
if (process.env.NODE_ENV !==
|
|
14
|
-
(function() {
|
|
15
|
-
'use strict'
|
|
16
|
-
|
|
17
|
-
var React = require('react')
|
|
18
|
-
|
|
19
|
-
// ATTENTION
|
|
20
|
-
// When adding new symbols to this file,
|
|
21
|
-
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
22
|
-
// The Symbol used to tag the ReactElement-like types.
|
|
23
|
-
var REACT_ELEMENT_TYPE = Symbol.for('react.element')
|
|
24
|
-
var REACT_PORTAL_TYPE = Symbol.for('react.portal')
|
|
25
|
-
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment')
|
|
26
|
-
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode')
|
|
27
|
-
var REACT_PROFILER_TYPE = Symbol.for('react.profiler')
|
|
28
|
-
var REACT_PROVIDER_TYPE = Symbol.for('react.provider')
|
|
29
|
-
var REACT_CONTEXT_TYPE = Symbol.for('react.context')
|
|
30
|
-
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref')
|
|
31
|
-
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense')
|
|
32
|
-
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list')
|
|
33
|
-
var REACT_MEMO_TYPE = Symbol.for('react.memo')
|
|
34
|
-
var REACT_LAZY_TYPE = Symbol.for('react.lazy')
|
|
35
|
-
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen')
|
|
36
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator
|
|
37
|
-
var FAUX_ITERATOR_SYMBOL = '@@iterator'
|
|
38
|
-
function getIteratorFn(maybeIterable) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
44
|
-
|
|
45
|
-
if (typeof maybeIterator === 'function') {
|
|
46
|
-
return maybeIterator;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
return null;
|
|
50
|
-
}
|
|
11
|
+
'use strict'
|
|
12
|
+
|
|
13
|
+
if (process.env.NODE_ENV !== 'production') {
|
|
14
|
+
;(function () {
|
|
15
|
+
'use strict'
|
|
16
|
+
|
|
17
|
+
var React = require('react')
|
|
18
|
+
|
|
19
|
+
// ATTENTION
|
|
20
|
+
// When adding new symbols to this file,
|
|
21
|
+
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
22
|
+
// The Symbol used to tag the ReactElement-like types.
|
|
23
|
+
var REACT_ELEMENT_TYPE = Symbol.for('react.element')
|
|
24
|
+
var REACT_PORTAL_TYPE = Symbol.for('react.portal')
|
|
25
|
+
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment')
|
|
26
|
+
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode')
|
|
27
|
+
var REACT_PROFILER_TYPE = Symbol.for('react.profiler')
|
|
28
|
+
var REACT_PROVIDER_TYPE = Symbol.for('react.provider')
|
|
29
|
+
var REACT_CONTEXT_TYPE = Symbol.for('react.context')
|
|
30
|
+
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref')
|
|
31
|
+
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense')
|
|
32
|
+
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list')
|
|
33
|
+
var REACT_MEMO_TYPE = Symbol.for('react.memo')
|
|
34
|
+
var REACT_LAZY_TYPE = Symbol.for('react.lazy')
|
|
35
|
+
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen')
|
|
36
|
+
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator
|
|
37
|
+
var FAUX_ITERATOR_SYMBOL = '@@iterator'
|
|
38
|
+
function getIteratorFn(maybeIterable) {
|
|
39
|
+
if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
|
40
|
+
return null
|
|
41
|
+
}
|
|
51
42
|
|
|
52
|
-
var
|
|
43
|
+
var maybeIterator =
|
|
44
|
+
(MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL]) ||
|
|
45
|
+
maybeIterable[FAUX_ITERATOR_SYMBOL]
|
|
53
46
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
{
|
|
57
|
-
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
58
|
-
args[_key2 - 1] = arguments[_key2];
|
|
47
|
+
if (typeof maybeIterator === 'function') {
|
|
48
|
+
return maybeIterator
|
|
59
49
|
}
|
|
60
50
|
|
|
61
|
-
|
|
51
|
+
return null
|
|
62
52
|
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
function printWarning(level, format, args) {
|
|
67
|
-
// When changing this logic, you might want to also
|
|
68
|
-
// update consoleWithStackDev.www.js as well.
|
|
69
|
-
{
|
|
70
|
-
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
71
|
-
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
72
|
-
|
|
73
|
-
if (stack !== '') {
|
|
74
|
-
format += '%s';
|
|
75
|
-
args = args.concat([stack]);
|
|
76
|
-
} // eslint-disable-next-line react-internal/safe-string-coercion
|
|
77
53
|
|
|
54
|
+
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED
|
|
78
55
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
56
|
+
function error(format) {
|
|
57
|
+
{
|
|
58
|
+
{
|
|
59
|
+
for (
|
|
60
|
+
var _len2 = arguments.length,
|
|
61
|
+
args = new Array(_len2 > 1 ? _len2 - 1 : 0),
|
|
62
|
+
_key2 = 1;
|
|
63
|
+
_key2 < _len2;
|
|
64
|
+
_key2++
|
|
65
|
+
) {
|
|
66
|
+
args[_key2 - 1] = arguments[_key2]
|
|
67
|
+
}
|
|
82
68
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
69
|
+
printWarning('error', format, args)
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
}
|
|
86
73
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
74
|
+
function printWarning(level, format, args) {
|
|
75
|
+
// When changing this logic, you might want to also
|
|
76
|
+
// update consoleWithStackDev.www.js as well.
|
|
77
|
+
{
|
|
78
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame
|
|
79
|
+
var stack = ReactDebugCurrentFrame.getStackAddendum()
|
|
90
80
|
|
|
91
|
-
|
|
81
|
+
if (stack !== '') {
|
|
82
|
+
format += '%s'
|
|
83
|
+
args = args.concat([stack])
|
|
84
|
+
} // eslint-disable-next-line react-internal/safe-string-coercion
|
|
92
85
|
|
|
93
|
-
var
|
|
94
|
-
|
|
95
|
-
|
|
86
|
+
var argsWithFormat = args.map(function (item) {
|
|
87
|
+
return String(item)
|
|
88
|
+
}) // Careful: RN currently depends on this prefix
|
|
96
89
|
|
|
97
|
-
|
|
98
|
-
//
|
|
99
|
-
//
|
|
90
|
+
argsWithFormat.unshift('Warning: ' + format) // We intentionally don't use spread (or .apply) directly because it
|
|
91
|
+
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
92
|
+
// eslint-disable-next-line react-internal/no-production-logging
|
|
100
93
|
|
|
101
|
-
|
|
94
|
+
Function.prototype.apply.call(console[level], console, argsWithFormat)
|
|
95
|
+
}
|
|
96
|
+
}
|
|
102
97
|
|
|
103
|
-
|
|
98
|
+
// -----------------------------------------------------------------------------
|
|
104
99
|
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
100
|
+
var enableScopeAPI = false // Experimental Create Event Handle API.
|
|
101
|
+
var enableCacheElement = false
|
|
102
|
+
var enableTransitionTracing = false // No known bugs, but needs performance testing
|
|
108
103
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
104
|
+
var enableLegacyHidden = false // Enables unstable_avoidThisFallback feature in Fiber
|
|
105
|
+
// stuff. Intended to enable React core members to more easily debug scheduling
|
|
106
|
+
// issues in DEV builds.
|
|
113
107
|
|
|
108
|
+
var enableDebugTracing = false // Track which Fiber(s) schedule render work.
|
|
114
109
|
|
|
115
|
-
|
|
116
|
-
return true;
|
|
117
|
-
}
|
|
110
|
+
var REACT_MODULE_REFERENCE
|
|
118
111
|
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
// types supported by any Flight configuration anywhere since
|
|
122
|
-
// we don't know which Flight build this will end up being used
|
|
123
|
-
// with.
|
|
124
|
-
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
|
|
125
|
-
return true;
|
|
112
|
+
{
|
|
113
|
+
REACT_MODULE_REFERENCE = Symbol.for('react.module.reference')
|
|
126
114
|
}
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return false;
|
|
130
|
-
}
|
|
131
115
|
|
|
132
|
-
function
|
|
133
|
-
|
|
116
|
+
function isValidElementType(type) {
|
|
117
|
+
if (typeof type === 'string' || typeof type === 'function') {
|
|
118
|
+
return true
|
|
119
|
+
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
120
|
+
|
|
121
|
+
if (
|
|
122
|
+
type === REACT_FRAGMENT_TYPE ||
|
|
123
|
+
type === REACT_PROFILER_TYPE ||
|
|
124
|
+
enableDebugTracing ||
|
|
125
|
+
type === REACT_STRICT_MODE_TYPE ||
|
|
126
|
+
type === REACT_SUSPENSE_TYPE ||
|
|
127
|
+
type === REACT_SUSPENSE_LIST_TYPE ||
|
|
128
|
+
enableLegacyHidden ||
|
|
129
|
+
type === REACT_OFFSCREEN_TYPE ||
|
|
130
|
+
enableScopeAPI ||
|
|
131
|
+
enableCacheElement ||
|
|
132
|
+
enableTransitionTracing
|
|
133
|
+
) {
|
|
134
|
+
return true
|
|
135
|
+
}
|
|
134
136
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
137
|
+
if (typeof type === 'object' && type !== null) {
|
|
138
|
+
if (
|
|
139
|
+
type.$$typeof === REACT_LAZY_TYPE ||
|
|
140
|
+
type.$$typeof === REACT_MEMO_TYPE ||
|
|
141
|
+
type.$$typeof === REACT_PROVIDER_TYPE ||
|
|
142
|
+
type.$$typeof === REACT_CONTEXT_TYPE ||
|
|
143
|
+
type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
|
|
144
|
+
// types supported by any Flight configuration anywhere since
|
|
145
|
+
// we don't know which Flight build this will end up being used
|
|
146
|
+
// with.
|
|
147
|
+
type.$$typeof === REACT_MODULE_REFERENCE ||
|
|
148
|
+
type.getModuleId !== undefined
|
|
149
|
+
) {
|
|
150
|
+
return true
|
|
151
|
+
}
|
|
152
|
+
}
|
|
138
153
|
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
} // Keep in sync with react-reconciler/getComponentNameFromFiber
|
|
154
|
+
return false
|
|
155
|
+
}
|
|
142
156
|
|
|
157
|
+
function getWrappedName(outerType, innerType, wrapperName) {
|
|
158
|
+
var displayName = outerType.displayName
|
|
143
159
|
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
}
|
|
160
|
+
if (displayName) {
|
|
161
|
+
return displayName
|
|
162
|
+
}
|
|
147
163
|
|
|
164
|
+
var functionName = innerType.displayName || innerType.name || ''
|
|
165
|
+
return functionName !== '' ? wrapperName + '(' + functionName + ')' : wrapperName
|
|
166
|
+
} // Keep in sync with react-reconciler/getComponentNameFromFiber
|
|
148
167
|
|
|
149
|
-
function
|
|
150
|
-
|
|
151
|
-
//
|
|
152
|
-
return null;
|
|
153
|
-
}
|
|
168
|
+
function getContextName(type) {
|
|
169
|
+
return type.displayName || 'Context'
|
|
170
|
+
} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
|
|
154
171
|
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
172
|
+
function getComponentNameFromType(type) {
|
|
173
|
+
if (type == null) {
|
|
174
|
+
// Host root, text node or just invalid type.
|
|
175
|
+
return null
|
|
176
|
+
}
|
|
160
177
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
178
|
+
{
|
|
179
|
+
if (typeof type.tag === 'number') {
|
|
180
|
+
error(
|
|
181
|
+
'Received an unexpected object in getComponentNameFromType(). ' +
|
|
182
|
+
'This is likely a bug in React. Please file an issue.'
|
|
183
|
+
)
|
|
184
|
+
}
|
|
185
|
+
}
|
|
164
186
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
187
|
+
if (typeof type === 'function') {
|
|
188
|
+
return type.displayName || type.name || null
|
|
189
|
+
}
|
|
168
190
|
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
191
|
+
if (typeof type === 'string') {
|
|
192
|
+
return type
|
|
193
|
+
}
|
|
172
194
|
|
|
173
|
-
|
|
174
|
-
|
|
195
|
+
switch (type) {
|
|
196
|
+
case REACT_FRAGMENT_TYPE:
|
|
197
|
+
return 'Fragment'
|
|
175
198
|
|
|
176
|
-
|
|
177
|
-
|
|
199
|
+
case REACT_PORTAL_TYPE:
|
|
200
|
+
return 'Portal'
|
|
178
201
|
|
|
179
|
-
|
|
180
|
-
|
|
202
|
+
case REACT_PROFILER_TYPE:
|
|
203
|
+
return 'Profiler'
|
|
181
204
|
|
|
182
|
-
|
|
183
|
-
|
|
205
|
+
case REACT_STRICT_MODE_TYPE:
|
|
206
|
+
return 'StrictMode'
|
|
184
207
|
|
|
185
|
-
|
|
186
|
-
|
|
208
|
+
case REACT_SUSPENSE_TYPE:
|
|
209
|
+
return 'Suspense'
|
|
187
210
|
|
|
188
|
-
|
|
211
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
212
|
+
return 'SuspenseList'
|
|
213
|
+
}
|
|
189
214
|
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
215
|
+
if (typeof type === 'object') {
|
|
216
|
+
switch (type.$$typeof) {
|
|
217
|
+
case REACT_CONTEXT_TYPE:
|
|
218
|
+
var context = type
|
|
219
|
+
return getContextName(context) + '.Consumer'
|
|
195
220
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
221
|
+
case REACT_PROVIDER_TYPE:
|
|
222
|
+
var provider = type
|
|
223
|
+
return getContextName(provider._context) + '.Provider'
|
|
199
224
|
|
|
200
|
-
|
|
201
|
-
|
|
225
|
+
case REACT_FORWARD_REF_TYPE:
|
|
226
|
+
return getWrappedName(type, type.render, 'ForwardRef')
|
|
202
227
|
|
|
203
|
-
|
|
204
|
-
|
|
228
|
+
case REACT_MEMO_TYPE:
|
|
229
|
+
var outerName = type.displayName || null
|
|
205
230
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
231
|
+
if (outerName !== null) {
|
|
232
|
+
return outerName
|
|
233
|
+
}
|
|
209
234
|
|
|
210
|
-
|
|
235
|
+
return getComponentNameFromType(type.type) || 'Memo'
|
|
211
236
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
var init = lazyComponent._init;
|
|
237
|
+
case REACT_LAZY_TYPE: {
|
|
238
|
+
var lazyComponent = type
|
|
239
|
+
var payload = lazyComponent._payload
|
|
240
|
+
var init = lazyComponent._init
|
|
217
241
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
242
|
+
try {
|
|
243
|
+
return getComponentNameFromType(init(payload))
|
|
244
|
+
} catch (x) {
|
|
245
|
+
return null
|
|
246
|
+
}
|
|
222
247
|
}
|
|
248
|
+
|
|
249
|
+
// eslint-disable-next-line no-fallthrough
|
|
223
250
|
}
|
|
251
|
+
}
|
|
224
252
|
|
|
225
|
-
|
|
253
|
+
return null
|
|
226
254
|
}
|
|
227
|
-
}
|
|
228
255
|
|
|
229
|
-
|
|
230
|
-
|
|
256
|
+
var assign = Object.assign
|
|
257
|
+
|
|
258
|
+
// Helpers to patch console.logs to avoid logging during side-effect free
|
|
259
|
+
// replaying on render function. This currently only patches the object
|
|
260
|
+
// lazily which won't cover if the log function was extracted eagerly.
|
|
261
|
+
// We could also eagerly patch the method.
|
|
262
|
+
var disabledDepth = 0
|
|
263
|
+
var prevLog
|
|
264
|
+
var prevInfo
|
|
265
|
+
var prevWarn
|
|
266
|
+
var prevError
|
|
267
|
+
var prevGroup
|
|
268
|
+
var prevGroupCollapsed
|
|
269
|
+
var prevGroupEnd
|
|
270
|
+
|
|
271
|
+
function disabledLog() {}
|
|
272
|
+
|
|
273
|
+
disabledLog.__reactDisabledLog = true
|
|
274
|
+
function disableLogs() {
|
|
275
|
+
{
|
|
276
|
+
if (disabledDepth === 0) {
|
|
277
|
+
/* eslint-disable react-internal/no-production-logging */
|
|
278
|
+
prevLog = console.log
|
|
279
|
+
prevInfo = console.info
|
|
280
|
+
prevWarn = console.warn
|
|
281
|
+
prevError = console.error
|
|
282
|
+
prevGroup = console.group
|
|
283
|
+
prevGroupCollapsed = console.groupCollapsed
|
|
284
|
+
prevGroupEnd = console.groupEnd // https://github.com/facebook/react/issues/19099
|
|
285
|
+
|
|
286
|
+
var props = {
|
|
287
|
+
configurable: true,
|
|
288
|
+
enumerable: true,
|
|
289
|
+
value: disabledLog,
|
|
290
|
+
writable: true,
|
|
291
|
+
} // $FlowFixMe Flow thinks console is immutable.
|
|
292
|
+
|
|
293
|
+
Object.defineProperties(console, {
|
|
294
|
+
info: props,
|
|
295
|
+
log: props,
|
|
296
|
+
warn: props,
|
|
297
|
+
error: props,
|
|
298
|
+
group: props,
|
|
299
|
+
groupCollapsed: props,
|
|
300
|
+
groupEnd: props,
|
|
301
|
+
})
|
|
302
|
+
/* eslint-enable react-internal/no-production-logging */
|
|
303
|
+
}
|
|
231
304
|
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
// Helpers to patch console.logs to avoid logging during side-effect free
|
|
235
|
-
// replaying on render function. This currently only patches the object
|
|
236
|
-
// lazily which won't cover if the log function was extracted eagerly.
|
|
237
|
-
// We could also eagerly patch the method.
|
|
238
|
-
var disabledDepth = 0;
|
|
239
|
-
var prevLog;
|
|
240
|
-
var prevInfo;
|
|
241
|
-
var prevWarn;
|
|
242
|
-
var prevError;
|
|
243
|
-
var prevGroup;
|
|
244
|
-
var prevGroupCollapsed;
|
|
245
|
-
var prevGroupEnd;
|
|
246
|
-
|
|
247
|
-
function disabledLog() {}
|
|
248
|
-
|
|
249
|
-
disabledLog.__reactDisabledLog = true;
|
|
250
|
-
function disableLogs() {
|
|
251
|
-
{
|
|
252
|
-
if (disabledDepth === 0) {
|
|
253
|
-
/* eslint-disable react-internal/no-production-logging */
|
|
254
|
-
prevLog = console.log;
|
|
255
|
-
prevInfo = console.info;
|
|
256
|
-
prevWarn = console.warn;
|
|
257
|
-
prevError = console.error;
|
|
258
|
-
prevGroup = console.group;
|
|
259
|
-
prevGroupCollapsed = console.groupCollapsed;
|
|
260
|
-
prevGroupEnd = console.groupEnd; // https://github.com/facebook/react/issues/19099
|
|
261
|
-
|
|
262
|
-
var props = {
|
|
263
|
-
configurable: true,
|
|
264
|
-
enumerable: true,
|
|
265
|
-
value: disabledLog,
|
|
266
|
-
writable: true
|
|
267
|
-
}; // $FlowFixMe Flow thinks console is immutable.
|
|
268
|
-
|
|
269
|
-
Object.defineProperties(console, {
|
|
270
|
-
info: props,
|
|
271
|
-
log: props,
|
|
272
|
-
warn: props,
|
|
273
|
-
error: props,
|
|
274
|
-
group: props,
|
|
275
|
-
groupCollapsed: props,
|
|
276
|
-
groupEnd: props
|
|
277
|
-
});
|
|
278
|
-
/* eslint-enable react-internal/no-production-logging */
|
|
305
|
+
disabledDepth++
|
|
306
|
+
}
|
|
279
307
|
}
|
|
308
|
+
function reenableLogs() {
|
|
309
|
+
{
|
|
310
|
+
disabledDepth--
|
|
311
|
+
|
|
312
|
+
if (disabledDepth === 0) {
|
|
313
|
+
/* eslint-disable react-internal/no-production-logging */
|
|
314
|
+
var props = {
|
|
315
|
+
configurable: true,
|
|
316
|
+
enumerable: true,
|
|
317
|
+
writable: true,
|
|
318
|
+
} // $FlowFixMe Flow thinks console is immutable.
|
|
319
|
+
|
|
320
|
+
Object.defineProperties(console, {
|
|
321
|
+
log: assign({}, props, {
|
|
322
|
+
value: prevLog,
|
|
323
|
+
}),
|
|
324
|
+
info: assign({}, props, {
|
|
325
|
+
value: prevInfo,
|
|
326
|
+
}),
|
|
327
|
+
warn: assign({}, props, {
|
|
328
|
+
value: prevWarn,
|
|
329
|
+
}),
|
|
330
|
+
error: assign({}, props, {
|
|
331
|
+
value: prevError,
|
|
332
|
+
}),
|
|
333
|
+
group: assign({}, props, {
|
|
334
|
+
value: prevGroup,
|
|
335
|
+
}),
|
|
336
|
+
groupCollapsed: assign({}, props, {
|
|
337
|
+
value: prevGroupCollapsed,
|
|
338
|
+
}),
|
|
339
|
+
groupEnd: assign({}, props, {
|
|
340
|
+
value: prevGroupEnd,
|
|
341
|
+
}),
|
|
342
|
+
})
|
|
343
|
+
/* eslint-enable react-internal/no-production-logging */
|
|
344
|
+
}
|
|
280
345
|
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
if (disabledDepth === 0) {
|
|
289
|
-
/* eslint-disable react-internal/no-production-logging */
|
|
290
|
-
var props = {
|
|
291
|
-
configurable: true,
|
|
292
|
-
enumerable: true,
|
|
293
|
-
writable: true
|
|
294
|
-
}; // $FlowFixMe Flow thinks console is immutable.
|
|
295
|
-
|
|
296
|
-
Object.defineProperties(console, {
|
|
297
|
-
log: assign({}, props, {
|
|
298
|
-
value: prevLog
|
|
299
|
-
}),
|
|
300
|
-
info: assign({}, props, {
|
|
301
|
-
value: prevInfo
|
|
302
|
-
}),
|
|
303
|
-
warn: assign({}, props, {
|
|
304
|
-
value: prevWarn
|
|
305
|
-
}),
|
|
306
|
-
error: assign({}, props, {
|
|
307
|
-
value: prevError
|
|
308
|
-
}),
|
|
309
|
-
group: assign({}, props, {
|
|
310
|
-
value: prevGroup
|
|
311
|
-
}),
|
|
312
|
-
groupCollapsed: assign({}, props, {
|
|
313
|
-
value: prevGroupCollapsed
|
|
314
|
-
}),
|
|
315
|
-
groupEnd: assign({}, props, {
|
|
316
|
-
value: prevGroupEnd
|
|
317
|
-
})
|
|
318
|
-
});
|
|
319
|
-
/* eslint-enable react-internal/no-production-logging */
|
|
346
|
+
if (disabledDepth < 0) {
|
|
347
|
+
error(
|
|
348
|
+
'disabledDepth fell below zero. ' +
|
|
349
|
+
'This is a bug in React. Please file an issue.'
|
|
350
|
+
)
|
|
351
|
+
}
|
|
352
|
+
}
|
|
320
353
|
}
|
|
321
354
|
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
355
|
+
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher
|
|
356
|
+
var prefix
|
|
357
|
+
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
358
|
+
{
|
|
359
|
+
if (prefix === undefined) {
|
|
360
|
+
// Extract the VM specific prefix used by each line.
|
|
361
|
+
try {
|
|
362
|
+
throw Error()
|
|
363
|
+
} catch (x) {
|
|
364
|
+
var match = x.stack.trim().match(/\n( *(at )?)/)
|
|
365
|
+
prefix = (match && match[1]) || ''
|
|
366
|
+
}
|
|
367
|
+
} // We use the prefix to ensure our stacks line up with native stack frames.
|
|
327
368
|
|
|
328
|
-
|
|
329
|
-
var prefix;
|
|
330
|
-
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
331
|
-
{
|
|
332
|
-
if (prefix === undefined) {
|
|
333
|
-
// Extract the VM specific prefix used by each line.
|
|
334
|
-
try {
|
|
335
|
-
throw Error();
|
|
336
|
-
} catch (x) {
|
|
337
|
-
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
338
|
-
prefix = match && match[1] || '';
|
|
369
|
+
return '\n' + prefix + name
|
|
339
370
|
}
|
|
340
|
-
}
|
|
341
|
-
|
|
371
|
+
}
|
|
372
|
+
var reentry = false
|
|
373
|
+
var componentFrameCache
|
|
342
374
|
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
var componentFrameCache;
|
|
375
|
+
{
|
|
376
|
+
var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map
|
|
377
|
+
componentFrameCache = new PossiblyWeakMap()
|
|
378
|
+
}
|
|
348
379
|
|
|
349
|
-
{
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
380
|
+
function describeNativeComponentFrame(fn, construct) {
|
|
381
|
+
// If something asked for a stack inside a fake render, it should get ignored.
|
|
382
|
+
if (!fn || reentry) {
|
|
383
|
+
return ''
|
|
384
|
+
}
|
|
353
385
|
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
if ( !fn || reentry) {
|
|
357
|
-
return '';
|
|
358
|
-
}
|
|
386
|
+
{
|
|
387
|
+
var frame = componentFrameCache.get(fn)
|
|
359
388
|
|
|
360
|
-
|
|
361
|
-
|
|
389
|
+
if (frame !== undefined) {
|
|
390
|
+
return frame
|
|
391
|
+
}
|
|
392
|
+
}
|
|
362
393
|
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
}
|
|
394
|
+
var control
|
|
395
|
+
reentry = true
|
|
396
|
+
var previousPrepareStackTrace = Error.prepareStackTrace // $FlowFixMe It does accept undefined.
|
|
367
397
|
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
var previousPrepareStackTrace = Error.prepareStackTrace; // $FlowFixMe It does accept undefined.
|
|
398
|
+
Error.prepareStackTrace = undefined
|
|
399
|
+
var previousDispatcher
|
|
371
400
|
|
|
372
|
-
|
|
373
|
-
|
|
401
|
+
{
|
|
402
|
+
previousDispatcher = ReactCurrentDispatcher.current // Set the dispatcher in DEV because this might be call in the render function
|
|
403
|
+
// for warnings.
|
|
374
404
|
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
405
|
+
ReactCurrentDispatcher.current = null
|
|
406
|
+
disableLogs()
|
|
407
|
+
}
|
|
378
408
|
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
409
|
+
try {
|
|
410
|
+
// This should throw.
|
|
411
|
+
if (construct) {
|
|
412
|
+
// Something should be setting the props in the constructor.
|
|
413
|
+
var Fake = function () {
|
|
414
|
+
throw Error()
|
|
415
|
+
} // $FlowFixMe
|
|
416
|
+
|
|
417
|
+
Object.defineProperty(Fake.prototype, 'props', {
|
|
418
|
+
set: function () {
|
|
419
|
+
// We use a throwing setter instead of frozen or non-writable props
|
|
420
|
+
// because that won't throw in a non-strict mode function.
|
|
421
|
+
throw Error()
|
|
422
|
+
},
|
|
423
|
+
})
|
|
424
|
+
|
|
425
|
+
if (typeof Reflect === 'object' && Reflect.construct) {
|
|
426
|
+
// We construct a different control for this case to include any extra
|
|
427
|
+
// frames added by the construct call.
|
|
428
|
+
try {
|
|
429
|
+
Reflect.construct(Fake, [])
|
|
430
|
+
} catch (x) {
|
|
431
|
+
control = x
|
|
432
|
+
}
|
|
382
433
|
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
434
|
+
Reflect.construct(fn, [], Fake)
|
|
435
|
+
} else {
|
|
436
|
+
try {
|
|
437
|
+
Fake.call()
|
|
438
|
+
} catch (x) {
|
|
439
|
+
control = x
|
|
440
|
+
}
|
|
390
441
|
|
|
442
|
+
fn.call(Fake.prototype)
|
|
443
|
+
}
|
|
444
|
+
} else {
|
|
445
|
+
try {
|
|
446
|
+
throw Error()
|
|
447
|
+
} catch (x) {
|
|
448
|
+
control = x
|
|
449
|
+
}
|
|
391
450
|
|
|
392
|
-
|
|
393
|
-
set: function () {
|
|
394
|
-
// We use a throwing setter instead of frozen or non-writable props
|
|
395
|
-
// because that won't throw in a non-strict mode function.
|
|
396
|
-
throw Error();
|
|
451
|
+
fn()
|
|
397
452
|
}
|
|
398
|
-
})
|
|
453
|
+
} catch (sample) {
|
|
454
|
+
// This is inlined manually because closure doesn't do it for us.
|
|
455
|
+
if (sample && control && typeof sample.stack === 'string') {
|
|
456
|
+
// This extracts the first frame from the sample that isn't also in the control.
|
|
457
|
+
// Skipping one frame that we assume is the frame that calls the two.
|
|
458
|
+
var sampleLines = sample.stack.split('\n')
|
|
459
|
+
var controlLines = control.stack.split('\n')
|
|
460
|
+
var s = sampleLines.length - 1
|
|
461
|
+
var c = controlLines.length - 1
|
|
462
|
+
|
|
463
|
+
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
464
|
+
// We expect at least one stack frame to be shared.
|
|
465
|
+
// Typically this will be the root most one. However, stack frames may be
|
|
466
|
+
// cut off due to maximum stack limits. In this case, one maybe cut off
|
|
467
|
+
// earlier than the other. We assume that the sample is longer or the same
|
|
468
|
+
// and there for cut off earlier. So we should find the root most frame in
|
|
469
|
+
// the sample somewhere in the control.
|
|
470
|
+
c--
|
|
471
|
+
}
|
|
399
472
|
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
473
|
+
for (; s >= 1 && c >= 0; s--, c--) {
|
|
474
|
+
// Next we find the first one that isn't the same which should be the
|
|
475
|
+
// frame that called our sample function and the control.
|
|
476
|
+
if (sampleLines[s] !== controlLines[c]) {
|
|
477
|
+
// In V8, the first line is describing the message but other VMs don't.
|
|
478
|
+
// If we're about to return the first line, and the control is also on the same
|
|
479
|
+
// line, that's a pretty good indicator that our sample threw at same line as
|
|
480
|
+
// the control. I.e. before we entered the sample frame. So we ignore this result.
|
|
481
|
+
// This can happen if you passed a class to function component, or non-function.
|
|
482
|
+
if (s !== 1 || c !== 1) {
|
|
483
|
+
do {
|
|
484
|
+
s--
|
|
485
|
+
c-- // We may still have similar intermediate frames from the construct call.
|
|
486
|
+
// The next one that isn't the same should be our match though.
|
|
487
|
+
|
|
488
|
+
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
489
|
+
// V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
|
|
490
|
+
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ') // If our component frame is labeled "<anonymous>"
|
|
491
|
+
// but we have a user-provided "displayName"
|
|
492
|
+
// splice it in to make the stack more readable.
|
|
493
|
+
|
|
494
|
+
if (fn.displayName && _frame.includes('<anonymous>')) {
|
|
495
|
+
_frame = _frame.replace('<anonymous>', fn.displayName)
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
{
|
|
499
|
+
if (typeof fn === 'function') {
|
|
500
|
+
componentFrameCache.set(fn, _frame)
|
|
501
|
+
}
|
|
502
|
+
} // Return the line we found.
|
|
503
|
+
|
|
504
|
+
return _frame
|
|
505
|
+
}
|
|
506
|
+
} while (s >= 1 && c >= 0)
|
|
507
|
+
}
|
|
408
508
|
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
Fake.call();
|
|
413
|
-
} catch (x) {
|
|
414
|
-
control = x;
|
|
509
|
+
break
|
|
510
|
+
}
|
|
511
|
+
}
|
|
415
512
|
}
|
|
513
|
+
} finally {
|
|
514
|
+
reentry = false
|
|
416
515
|
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
throw Error();
|
|
422
|
-
} catch (x) {
|
|
423
|
-
control = x;
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
fn();
|
|
427
|
-
}
|
|
428
|
-
} catch (sample) {
|
|
429
|
-
// This is inlined manually because closure doesn't do it for us.
|
|
430
|
-
if (sample && control && typeof sample.stack === 'string') {
|
|
431
|
-
// This extracts the first frame from the sample that isn't also in the control.
|
|
432
|
-
// Skipping one frame that we assume is the frame that calls the two.
|
|
433
|
-
var sampleLines = sample.stack.split('\n');
|
|
434
|
-
var controlLines = control.stack.split('\n');
|
|
435
|
-
var s = sampleLines.length - 1;
|
|
436
|
-
var c = controlLines.length - 1;
|
|
437
|
-
|
|
438
|
-
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
439
|
-
// We expect at least one stack frame to be shared.
|
|
440
|
-
// Typically this will be the root most one. However, stack frames may be
|
|
441
|
-
// cut off due to maximum stack limits. In this case, one maybe cut off
|
|
442
|
-
// earlier than the other. We assume that the sample is longer or the same
|
|
443
|
-
// and there for cut off earlier. So we should find the root most frame in
|
|
444
|
-
// the sample somewhere in the control.
|
|
445
|
-
c--;
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
for (; s >= 1 && c >= 0; s--, c--) {
|
|
449
|
-
// Next we find the first one that isn't the same which should be the
|
|
450
|
-
// frame that called our sample function and the control.
|
|
451
|
-
if (sampleLines[s] !== controlLines[c]) {
|
|
452
|
-
// In V8, the first line is describing the message but other VMs don't.
|
|
453
|
-
// If we're about to return the first line, and the control is also on the same
|
|
454
|
-
// line, that's a pretty good indicator that our sample threw at same line as
|
|
455
|
-
// the control. I.e. before we entered the sample frame. So we ignore this result.
|
|
456
|
-
// This can happen if you passed a class to function component, or non-function.
|
|
457
|
-
if (s !== 1 || c !== 1) {
|
|
458
|
-
do {
|
|
459
|
-
s--;
|
|
460
|
-
c--; // We may still have similar intermediate frames from the construct call.
|
|
461
|
-
// The next one that isn't the same should be our match though.
|
|
462
|
-
|
|
463
|
-
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
464
|
-
// V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
|
|
465
|
-
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
|
|
466
|
-
// but we have a user-provided "displayName"
|
|
467
|
-
// splice it in to make the stack more readable.
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
if (fn.displayName && _frame.includes('<anonymous>')) {
|
|
471
|
-
_frame = _frame.replace('<anonymous>', fn.displayName);
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
{
|
|
475
|
-
if (typeof fn === 'function') {
|
|
476
|
-
componentFrameCache.set(fn, _frame);
|
|
477
|
-
}
|
|
478
|
-
} // Return the line we found.
|
|
516
|
+
{
|
|
517
|
+
ReactCurrentDispatcher.current = previousDispatcher
|
|
518
|
+
reenableLogs()
|
|
519
|
+
}
|
|
479
520
|
|
|
521
|
+
Error.prepareStackTrace = previousPrepareStackTrace
|
|
522
|
+
} // Fallback to just using the name if we couldn't make it throw.
|
|
480
523
|
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
} while (s >= 1 && c >= 0);
|
|
484
|
-
}
|
|
524
|
+
var name = fn ? fn.displayName || fn.name : ''
|
|
525
|
+
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : ''
|
|
485
526
|
|
|
486
|
-
|
|
527
|
+
{
|
|
528
|
+
if (typeof fn === 'function') {
|
|
529
|
+
componentFrameCache.set(fn, syntheticFrame)
|
|
487
530
|
}
|
|
488
531
|
}
|
|
489
|
-
}
|
|
490
|
-
} finally {
|
|
491
|
-
reentry = false;
|
|
492
532
|
|
|
493
|
-
|
|
494
|
-
ReactCurrentDispatcher.current = previousDispatcher;
|
|
495
|
-
reenableLogs();
|
|
533
|
+
return syntheticFrame
|
|
496
534
|
}
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
var name = fn ? fn.displayName || fn.name : '';
|
|
503
|
-
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
|
|
504
|
-
|
|
505
|
-
{
|
|
506
|
-
if (typeof fn === 'function') {
|
|
507
|
-
componentFrameCache.set(fn, syntheticFrame);
|
|
535
|
+
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
536
|
+
{
|
|
537
|
+
return describeNativeComponentFrame(fn, false)
|
|
538
|
+
}
|
|
508
539
|
}
|
|
509
|
-
}
|
|
510
|
-
|
|
511
|
-
return syntheticFrame;
|
|
512
|
-
}
|
|
513
|
-
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
514
|
-
{
|
|
515
|
-
return describeNativeComponentFrame(fn, false);
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
function shouldConstruct(Component) {
|
|
520
|
-
var prototype = Component.prototype;
|
|
521
|
-
return !!(prototype && prototype.isReactComponent);
|
|
522
|
-
}
|
|
523
540
|
|
|
524
|
-
function
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
return '';
|
|
528
|
-
}
|
|
529
|
-
|
|
530
|
-
if (typeof type === 'function') {
|
|
531
|
-
{
|
|
532
|
-
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
541
|
+
function shouldConstruct(Component) {
|
|
542
|
+
var prototype = Component.prototype
|
|
543
|
+
return !!(prototype && prototype.isReactComponent)
|
|
533
544
|
}
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
if (typeof type === 'string') {
|
|
537
|
-
return describeBuiltInComponentFrame(type);
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
switch (type) {
|
|
541
|
-
case REACT_SUSPENSE_TYPE:
|
|
542
|
-
return describeBuiltInComponentFrame('Suspense');
|
|
543
545
|
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
if (typeof type === 'object') {
|
|
549
|
-
switch (type.$$typeof) {
|
|
550
|
-
case REACT_FORWARD_REF_TYPE:
|
|
551
|
-
return describeFunctionComponentFrame(type.render);
|
|
552
|
-
|
|
553
|
-
case REACT_MEMO_TYPE:
|
|
554
|
-
// Memo may contain any component type so we recursively resolve it.
|
|
555
|
-
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
546
|
+
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
547
|
+
if (type == null) {
|
|
548
|
+
return ''
|
|
549
|
+
}
|
|
556
550
|
|
|
557
|
-
|
|
551
|
+
if (typeof type === 'function') {
|
|
558
552
|
{
|
|
559
|
-
|
|
560
|
-
var payload = lazyComponent._payload;
|
|
561
|
-
var init = lazyComponent._init;
|
|
562
|
-
|
|
563
|
-
try {
|
|
564
|
-
// Lazy may contain any component type so we recursively resolve it.
|
|
565
|
-
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
566
|
-
} catch (x) {}
|
|
553
|
+
return describeNativeComponentFrame(type, shouldConstruct(type))
|
|
567
554
|
}
|
|
568
|
-
|
|
569
|
-
}
|
|
555
|
+
}
|
|
570
556
|
|
|
571
|
-
|
|
572
|
-
|
|
557
|
+
if (typeof type === 'string') {
|
|
558
|
+
return describeBuiltInComponentFrame(type)
|
|
559
|
+
}
|
|
573
560
|
|
|
574
|
-
|
|
561
|
+
switch (type) {
|
|
562
|
+
case REACT_SUSPENSE_TYPE:
|
|
563
|
+
return describeBuiltInComponentFrame('Suspense')
|
|
575
564
|
|
|
576
|
-
|
|
577
|
-
|
|
565
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
566
|
+
return describeBuiltInComponentFrame('SuspenseList')
|
|
567
|
+
}
|
|
578
568
|
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
584
|
-
ReactDebugCurrentFrame.setExtraStackFrame(stack);
|
|
585
|
-
} else {
|
|
586
|
-
ReactDebugCurrentFrame.setExtraStackFrame(null);
|
|
587
|
-
}
|
|
588
|
-
}
|
|
589
|
-
}
|
|
569
|
+
if (typeof type === 'object') {
|
|
570
|
+
switch (type.$$typeof) {
|
|
571
|
+
case REACT_FORWARD_REF_TYPE:
|
|
572
|
+
return describeFunctionComponentFrame(type.render)
|
|
590
573
|
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
var has = Function.call.bind(hasOwnProperty);
|
|
574
|
+
case REACT_MEMO_TYPE:
|
|
575
|
+
// Memo may contain any component type so we recursively resolve it.
|
|
576
|
+
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn)
|
|
595
577
|
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
// After these have been cleaned up, we'll let them throw.
|
|
578
|
+
case REACT_LAZY_TYPE: {
|
|
579
|
+
var lazyComponent = type
|
|
580
|
+
var payload = lazyComponent._payload
|
|
581
|
+
var init = lazyComponent._init
|
|
601
582
|
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
// eslint-disable-next-line react-internal/prod-error-codes
|
|
607
|
-
var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
|
|
608
|
-
err.name = 'Invariant Violation';
|
|
609
|
-
throw err;
|
|
583
|
+
try {
|
|
584
|
+
// Lazy may contain any component type so we recursively resolve it.
|
|
585
|
+
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn)
|
|
586
|
+
} catch (x) {}
|
|
610
587
|
}
|
|
611
|
-
|
|
612
|
-
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
|
|
613
|
-
} catch (ex) {
|
|
614
|
-
error$1 = ex;
|
|
615
588
|
}
|
|
589
|
+
}
|
|
616
590
|
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);
|
|
621
|
-
|
|
622
|
-
setCurrentlyValidatingElement(null);
|
|
623
|
-
}
|
|
591
|
+
return ''
|
|
592
|
+
}
|
|
624
593
|
|
|
625
|
-
|
|
626
|
-
// Only monitor this failure once because there tends to be a lot of the
|
|
627
|
-
// same error.
|
|
628
|
-
loggedTypeFailures[error$1.message] = true;
|
|
629
|
-
setCurrentlyValidatingElement(element);
|
|
594
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty
|
|
630
595
|
|
|
631
|
-
|
|
596
|
+
var loggedTypeFailures = {}
|
|
597
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame
|
|
632
598
|
|
|
633
|
-
|
|
599
|
+
function setCurrentlyValidatingElement(element) {
|
|
600
|
+
{
|
|
601
|
+
if (element) {
|
|
602
|
+
var owner = element._owner
|
|
603
|
+
var stack = describeUnknownElementTypeFrameInDEV(
|
|
604
|
+
element.type,
|
|
605
|
+
element._source,
|
|
606
|
+
owner ? owner.type : null
|
|
607
|
+
)
|
|
608
|
+
ReactDebugCurrentFrame.setExtraStackFrame(stack)
|
|
609
|
+
} else {
|
|
610
|
+
ReactDebugCurrentFrame.setExtraStackFrame(null)
|
|
634
611
|
}
|
|
635
612
|
}
|
|
636
613
|
}
|
|
637
|
-
}
|
|
638
|
-
}
|
|
639
614
|
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
//
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
function
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
} catch (e) {
|
|
672
|
-
return true;
|
|
673
|
-
}
|
|
674
|
-
}
|
|
675
|
-
}
|
|
615
|
+
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
616
|
+
{
|
|
617
|
+
// $FlowFixMe This is okay but Flow doesn't know it.
|
|
618
|
+
var has = Function.call.bind(hasOwnProperty)
|
|
619
|
+
|
|
620
|
+
for (var typeSpecName in typeSpecs) {
|
|
621
|
+
if (has(typeSpecs, typeSpecName)) {
|
|
622
|
+
var error$1 = void 0 // Prop type validation may throw. In case they do, we don't want to
|
|
623
|
+
// fail the render phase where it didn't fail before. So we log it.
|
|
624
|
+
// After these have been cleaned up, we'll let them throw.
|
|
625
|
+
|
|
626
|
+
try {
|
|
627
|
+
// This is intentionally an invariant that gets caught. It's the same
|
|
628
|
+
// behavior as without this statement except with a better message.
|
|
629
|
+
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
630
|
+
// eslint-disable-next-line react-internal/prod-error-codes
|
|
631
|
+
var err = Error(
|
|
632
|
+
(componentName || 'React class') +
|
|
633
|
+
': ' +
|
|
634
|
+
location +
|
|
635
|
+
' type `' +
|
|
636
|
+
typeSpecName +
|
|
637
|
+
'` is invalid; ' +
|
|
638
|
+
'it must be a function, usually from the `prop-types` package, but received `' +
|
|
639
|
+
typeof typeSpecs[typeSpecName] +
|
|
640
|
+
'`.' +
|
|
641
|
+
'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.'
|
|
642
|
+
)
|
|
643
|
+
err.name = 'Invariant Violation'
|
|
644
|
+
throw err
|
|
645
|
+
}
|
|
676
646
|
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
// methods are needed to perform accurate arithmetic or comparison.)
|
|
689
|
-
//
|
|
690
|
-
// To fix the problem, coerce this object or symbol value to a string before
|
|
691
|
-
// passing it to React. The most reliable way is usually `String(value)`.
|
|
692
|
-
//
|
|
693
|
-
// To find which value is throwing, check the browser or debugger console.
|
|
694
|
-
// Before this exception was thrown, there should be `console.error` output
|
|
695
|
-
// that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
|
|
696
|
-
// problem and how that type was used: key, atrribute, input value prop, etc.
|
|
697
|
-
// In most cases, this console output also shows the component and its
|
|
698
|
-
// ancestor components where the exception happened.
|
|
699
|
-
//
|
|
700
|
-
// eslint-disable-next-line react-internal/safe-string-coercion
|
|
701
|
-
return '' + value;
|
|
702
|
-
}
|
|
703
|
-
function checkKeyStringCoercion(value) {
|
|
704
|
-
{
|
|
705
|
-
if (willCoercionThrow(value)) {
|
|
706
|
-
error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
|
|
647
|
+
error$1 = typeSpecs[typeSpecName](
|
|
648
|
+
values,
|
|
649
|
+
typeSpecName,
|
|
650
|
+
componentName,
|
|
651
|
+
location,
|
|
652
|
+
null,
|
|
653
|
+
'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED'
|
|
654
|
+
)
|
|
655
|
+
} catch (ex) {
|
|
656
|
+
error$1 = ex
|
|
657
|
+
}
|
|
707
658
|
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
659
|
+
if (error$1 && !(error$1 instanceof Error)) {
|
|
660
|
+
setCurrentlyValidatingElement(element)
|
|
661
|
+
|
|
662
|
+
error(
|
|
663
|
+
'%s: type specification of %s' +
|
|
664
|
+
' `%s` is invalid; the type checker ' +
|
|
665
|
+
'function must return `null` or an `Error` but returned a %s. ' +
|
|
666
|
+
'You may have forgotten to pass an argument to the type checker ' +
|
|
667
|
+
'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' +
|
|
668
|
+
'shape all require an argument).',
|
|
669
|
+
componentName || 'React class',
|
|
670
|
+
location,
|
|
671
|
+
typeSpecName,
|
|
672
|
+
typeof error$1
|
|
673
|
+
)
|
|
674
|
+
|
|
675
|
+
setCurrentlyValidatingElement(null)
|
|
676
|
+
}
|
|
712
677
|
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
__source: true
|
|
719
|
-
};
|
|
720
|
-
var specialPropKeyWarningShown;
|
|
721
|
-
var specialPropRefWarningShown;
|
|
722
|
-
var didWarnAboutStringRefs;
|
|
723
|
-
|
|
724
|
-
{
|
|
725
|
-
didWarnAboutStringRefs = {};
|
|
726
|
-
}
|
|
678
|
+
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
679
|
+
// Only monitor this failure once because there tends to be a lot of the
|
|
680
|
+
// same error.
|
|
681
|
+
loggedTypeFailures[error$1.message] = true
|
|
682
|
+
setCurrentlyValidatingElement(element)
|
|
727
683
|
|
|
728
|
-
|
|
729
|
-
{
|
|
730
|
-
if (hasOwnProperty.call(config, 'ref')) {
|
|
731
|
-
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
|
684
|
+
error('Failed %s type: %s', location, error$1.message)
|
|
732
685
|
|
|
733
|
-
|
|
734
|
-
|
|
686
|
+
setCurrentlyValidatingElement(null)
|
|
687
|
+
}
|
|
688
|
+
}
|
|
689
|
+
}
|
|
735
690
|
}
|
|
736
691
|
}
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
return config.ref !== undefined;
|
|
740
|
-
}
|
|
741
692
|
|
|
742
|
-
|
|
743
|
-
{
|
|
744
|
-
if (hasOwnProperty.call(config, 'key')) {
|
|
745
|
-
var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
|
|
693
|
+
var isArrayImpl = Array.isArray // eslint-disable-next-line no-redeclare
|
|
746
694
|
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
}
|
|
695
|
+
function isArray(a) {
|
|
696
|
+
return isArrayImpl(a)
|
|
750
697
|
}
|
|
751
|
-
}
|
|
752
|
-
|
|
753
|
-
return config.key !== undefined;
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
function warnIfStringRefCannotBeAutoConverted(config, self) {
|
|
757
|
-
{
|
|
758
|
-
if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
|
|
759
|
-
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
760
|
-
|
|
761
|
-
if (!didWarnAboutStringRefs[componentName]) {
|
|
762
|
-
error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);
|
|
763
698
|
|
|
764
|
-
|
|
699
|
+
/*
|
|
700
|
+
* The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
|
|
701
|
+
* and Temporal.* types. See https://github.com/facebook/react/pull/22064.
|
|
702
|
+
*
|
|
703
|
+
* The functions in this module will throw an easier-to-understand,
|
|
704
|
+
* easier-to-debug exception with a clear errors message message explaining the
|
|
705
|
+
* problem. (Instead of a confusing exception thrown inside the implementation
|
|
706
|
+
* of the `value` object).
|
|
707
|
+
*/
|
|
708
|
+
// $FlowFixMe only called in DEV, so void return is not possible.
|
|
709
|
+
function typeName(value) {
|
|
710
|
+
{
|
|
711
|
+
// toStringTag is needed for namespaced types like Temporal.Instant
|
|
712
|
+
var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag
|
|
713
|
+
var type =
|
|
714
|
+
(hasToStringTag && value[Symbol.toStringTag]) ||
|
|
715
|
+
value.constructor.name ||
|
|
716
|
+
'Object'
|
|
717
|
+
return type
|
|
765
718
|
}
|
|
766
|
-
}
|
|
767
|
-
}
|
|
768
|
-
}
|
|
719
|
+
} // $FlowFixMe only called in DEV, so void return is not possible.
|
|
769
720
|
|
|
770
|
-
function
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
721
|
+
function willCoercionThrow(value) {
|
|
722
|
+
{
|
|
723
|
+
try {
|
|
724
|
+
testStringCoercion(value)
|
|
725
|
+
return false
|
|
726
|
+
} catch (e) {
|
|
727
|
+
return true
|
|
728
|
+
}
|
|
777
729
|
}
|
|
778
|
-
}
|
|
779
|
-
|
|
780
|
-
warnAboutAccessingKey.isReactWarning = true;
|
|
781
|
-
Object.defineProperty(props, 'key', {
|
|
782
|
-
get: warnAboutAccessingKey,
|
|
783
|
-
configurable: true
|
|
784
|
-
});
|
|
785
|
-
}
|
|
786
|
-
}
|
|
787
|
-
|
|
788
|
-
function defineRefPropWarningGetter(props, displayName) {
|
|
789
|
-
{
|
|
790
|
-
var warnAboutAccessingRef = function () {
|
|
791
|
-
if (!specialPropRefWarningShown) {
|
|
792
|
-
specialPropRefWarningShown = true;
|
|
730
|
+
}
|
|
793
731
|
|
|
794
|
-
|
|
732
|
+
function testStringCoercion(value) {
|
|
733
|
+
// If you ended up here by following an exception call stack, here's what's
|
|
734
|
+
// happened: you supplied an object or symbol value to React (as a prop, key,
|
|
735
|
+
// DOM attribute, CSS property, string ref, etc.) and when React tried to
|
|
736
|
+
// coerce it to a string using `'' + value`, an exception was thrown.
|
|
737
|
+
//
|
|
738
|
+
// The most common types that will cause this exception are `Symbol` instances
|
|
739
|
+
// and Temporal objects like `Temporal.Instant`. But any object that has a
|
|
740
|
+
// `valueOf` or `[Symbol.toPrimitive]` method that throws will also cause this
|
|
741
|
+
// exception. (Library authors do this to prevent users from using built-in
|
|
742
|
+
// numeric operators like `+` or comparison operators like `>=` because custom
|
|
743
|
+
// methods are needed to perform accurate arithmetic or comparison.)
|
|
744
|
+
//
|
|
745
|
+
// To fix the problem, coerce this object or symbol value to a string before
|
|
746
|
+
// passing it to React. The most reliable way is usually `String(value)`.
|
|
747
|
+
//
|
|
748
|
+
// To find which value is throwing, check the browser or debugger console.
|
|
749
|
+
// Before this exception was thrown, there should be `console.error` output
|
|
750
|
+
// that shows the type (Symbol, Temporal.PlainDate, etc.) that caused the
|
|
751
|
+
// problem and how that type was used: key, atrribute, input value prop, etc.
|
|
752
|
+
// In most cases, this console output also shows the component and its
|
|
753
|
+
// ancestor components where the exception happened.
|
|
754
|
+
//
|
|
755
|
+
// eslint-disable-next-line react-internal/safe-string-coercion
|
|
756
|
+
return '' + value
|
|
757
|
+
}
|
|
758
|
+
function checkKeyStringCoercion(value) {
|
|
759
|
+
{
|
|
760
|
+
if (willCoercionThrow(value)) {
|
|
761
|
+
error(
|
|
762
|
+
'The provided key is an unsupported type %s.' +
|
|
763
|
+
' This value must be coerced to a string before before using it here.',
|
|
764
|
+
typeName(value)
|
|
765
|
+
)
|
|
766
|
+
|
|
767
|
+
return testStringCoercion(value) // throw (to help callers find troubleshooting comments)
|
|
768
|
+
}
|
|
795
769
|
}
|
|
796
|
-
}
|
|
797
|
-
|
|
798
|
-
warnAboutAccessingRef.isReactWarning = true;
|
|
799
|
-
Object.defineProperty(props, 'ref', {
|
|
800
|
-
get: warnAboutAccessingRef,
|
|
801
|
-
configurable: true
|
|
802
|
-
});
|
|
803
|
-
}
|
|
804
|
-
}
|
|
805
|
-
/**
|
|
806
|
-
* Factory method to create a new React element. This no longer adheres to
|
|
807
|
-
* the class pattern, so do not use new to call it. Also, instanceof check
|
|
808
|
-
* will not work. Instead test $$typeof field against Symbol.for('react.element') to check
|
|
809
|
-
* if something is a React Element.
|
|
810
|
-
*
|
|
811
|
-
* @param {*} type
|
|
812
|
-
* @param {*} props
|
|
813
|
-
* @param {*} key
|
|
814
|
-
* @param {string|object} ref
|
|
815
|
-
* @param {*} owner
|
|
816
|
-
* @param {*} self A *temporary* helper to detect places where `this` is
|
|
817
|
-
* different from the `owner` when React.createElement is called, so that we
|
|
818
|
-
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
|
819
|
-
* functions, and as long as `this` and owner are the same, there will be no
|
|
820
|
-
* change in behavior.
|
|
821
|
-
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
|
822
|
-
* indicating filename, line number, and/or other information.
|
|
823
|
-
* @internal
|
|
824
|
-
*/
|
|
770
|
+
}
|
|
825
771
|
|
|
772
|
+
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner
|
|
773
|
+
var RESERVED_PROPS = {
|
|
774
|
+
key: true,
|
|
775
|
+
ref: true,
|
|
776
|
+
__self: true,
|
|
777
|
+
__source: true,
|
|
778
|
+
}
|
|
779
|
+
var specialPropKeyWarningShown
|
|
780
|
+
var specialPropRefWarningShown
|
|
781
|
+
var didWarnAboutStringRefs
|
|
826
782
|
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
830
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
831
|
-
// Built-in properties that belong on the element
|
|
832
|
-
type: type,
|
|
833
|
-
key: key,
|
|
834
|
-
ref: ref,
|
|
835
|
-
props: props,
|
|
836
|
-
// Record the component responsible for creating this element.
|
|
837
|
-
_owner: owner
|
|
838
|
-
};
|
|
839
|
-
|
|
840
|
-
{
|
|
841
|
-
// The validation flag is currently mutative. We put it on
|
|
842
|
-
// an external backing store so that we can freeze the whole object.
|
|
843
|
-
// This can be replaced with a WeakMap once they are implemented in
|
|
844
|
-
// commonly used development environments.
|
|
845
|
-
element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
|
|
846
|
-
// the validation flag non-enumerable (where possible, which should
|
|
847
|
-
// include every environment we run tests in), so the test framework
|
|
848
|
-
// ignores it.
|
|
849
|
-
|
|
850
|
-
Object.defineProperty(element._store, 'validated', {
|
|
851
|
-
configurable: false,
|
|
852
|
-
enumerable: false,
|
|
853
|
-
writable: true,
|
|
854
|
-
value: false
|
|
855
|
-
}); // self and source are DEV only properties.
|
|
856
|
-
|
|
857
|
-
Object.defineProperty(element, '_self', {
|
|
858
|
-
configurable: false,
|
|
859
|
-
enumerable: false,
|
|
860
|
-
writable: false,
|
|
861
|
-
value: self
|
|
862
|
-
}); // Two elements created in two different places should be considered
|
|
863
|
-
// equal for testing purposes and therefore we hide it from enumeration.
|
|
864
|
-
|
|
865
|
-
Object.defineProperty(element, '_source', {
|
|
866
|
-
configurable: false,
|
|
867
|
-
enumerable: false,
|
|
868
|
-
writable: false,
|
|
869
|
-
value: source
|
|
870
|
-
});
|
|
871
|
-
|
|
872
|
-
if (Object.freeze) {
|
|
873
|
-
Object.freeze(element.props);
|
|
874
|
-
Object.freeze(element);
|
|
783
|
+
{
|
|
784
|
+
didWarnAboutStringRefs = {}
|
|
875
785
|
}
|
|
876
|
-
}
|
|
877
786
|
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
* @param {*} type
|
|
883
|
-
* @param {object} props
|
|
884
|
-
* @param {string} key
|
|
885
|
-
*/
|
|
787
|
+
function hasValidRef(config) {
|
|
788
|
+
{
|
|
789
|
+
if (hasOwnProperty.call(config, 'ref')) {
|
|
790
|
+
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get
|
|
886
791
|
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
792
|
+
if (getter && getter.isReactWarning) {
|
|
793
|
+
return false
|
|
794
|
+
}
|
|
795
|
+
}
|
|
796
|
+
}
|
|
890
797
|
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
var ref = null; // Currently, key can be spread in as a prop. This causes a potential
|
|
894
|
-
// issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
|
|
895
|
-
// or <div key="Hi" {...props} /> ). We want to deprecate key spread,
|
|
896
|
-
// but as an intermediary step, we will use jsxDEV for everything except
|
|
897
|
-
// <div {...props} key="Hi" />, because we aren't currently able to tell if
|
|
898
|
-
// key is explicitly declared to be undefined or not.
|
|
798
|
+
return config.ref !== undefined
|
|
799
|
+
}
|
|
899
800
|
|
|
900
|
-
|
|
801
|
+
function hasValidKey(config) {
|
|
901
802
|
{
|
|
902
|
-
|
|
803
|
+
if (hasOwnProperty.call(config, 'key')) {
|
|
804
|
+
var getter = Object.getOwnPropertyDescriptor(config, 'key').get
|
|
805
|
+
|
|
806
|
+
if (getter && getter.isReactWarning) {
|
|
807
|
+
return false
|
|
808
|
+
}
|
|
809
|
+
}
|
|
903
810
|
}
|
|
904
811
|
|
|
905
|
-
key
|
|
812
|
+
return config.key !== undefined
|
|
906
813
|
}
|
|
907
814
|
|
|
908
|
-
|
|
815
|
+
function warnIfStringRefCannotBeAutoConverted(config, self) {
|
|
909
816
|
{
|
|
910
|
-
|
|
817
|
+
if (
|
|
818
|
+
typeof config.ref === 'string' &&
|
|
819
|
+
ReactCurrentOwner.current &&
|
|
820
|
+
self &&
|
|
821
|
+
ReactCurrentOwner.current.stateNode !== self
|
|
822
|
+
) {
|
|
823
|
+
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type)
|
|
824
|
+
|
|
825
|
+
if (!didWarnAboutStringRefs[componentName]) {
|
|
826
|
+
error(
|
|
827
|
+
'Component "%s" contains the string ref "%s". ' +
|
|
828
|
+
'Support for string refs will be removed in a future major release. ' +
|
|
829
|
+
'This case cannot be automatically converted to an arrow function. ' +
|
|
830
|
+
'We ask you to manually fix this case by using useRef() or createRef() instead. ' +
|
|
831
|
+
'Learn more about using refs safely here: ' +
|
|
832
|
+
'https://reactjs.org/link/strict-mode-string-ref',
|
|
833
|
+
getComponentNameFromType(ReactCurrentOwner.current.type),
|
|
834
|
+
config.ref
|
|
835
|
+
)
|
|
836
|
+
|
|
837
|
+
didWarnAboutStringRefs[componentName] = true
|
|
838
|
+
}
|
|
839
|
+
}
|
|
911
840
|
}
|
|
912
|
-
|
|
913
|
-
key = '' + config.key;
|
|
914
841
|
}
|
|
915
842
|
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
843
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
844
|
+
{
|
|
845
|
+
var warnAboutAccessingKey = function () {
|
|
846
|
+
if (!specialPropKeyWarningShown) {
|
|
847
|
+
specialPropKeyWarningShown = true
|
|
848
|
+
|
|
849
|
+
error(
|
|
850
|
+
'%s: `key` is not a prop. Trying to access it will result ' +
|
|
851
|
+
'in `undefined` being returned. If you need to access the same ' +
|
|
852
|
+
'value within the child component, you should pass it as a different ' +
|
|
853
|
+
'prop. (https://reactjs.org/link/special-props)',
|
|
854
|
+
displayName
|
|
855
|
+
)
|
|
856
|
+
}
|
|
857
|
+
}
|
|
921
858
|
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
859
|
+
warnAboutAccessingKey.isReactWarning = true
|
|
860
|
+
Object.defineProperty(props, 'key', {
|
|
861
|
+
get: warnAboutAccessingKey,
|
|
862
|
+
configurable: true,
|
|
863
|
+
})
|
|
925
864
|
}
|
|
926
|
-
}
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
if (type && type.defaultProps) {
|
|
930
|
-
var defaultProps = type.defaultProps;
|
|
865
|
+
}
|
|
931
866
|
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
867
|
+
function defineRefPropWarningGetter(props, displayName) {
|
|
868
|
+
{
|
|
869
|
+
var warnAboutAccessingRef = function () {
|
|
870
|
+
if (!specialPropRefWarningShown) {
|
|
871
|
+
specialPropRefWarningShown = true
|
|
872
|
+
|
|
873
|
+
error(
|
|
874
|
+
'%s: `ref` is not a prop. Trying to access it will result ' +
|
|
875
|
+
'in `undefined` being returned. If you need to access the same ' +
|
|
876
|
+
'value within the child component, you should pass it as a different ' +
|
|
877
|
+
'prop. (https://reactjs.org/link/special-props)',
|
|
878
|
+
displayName
|
|
879
|
+
)
|
|
880
|
+
}
|
|
935
881
|
}
|
|
882
|
+
|
|
883
|
+
warnAboutAccessingRef.isReactWarning = true
|
|
884
|
+
Object.defineProperty(props, 'ref', {
|
|
885
|
+
get: warnAboutAccessingRef,
|
|
886
|
+
configurable: true,
|
|
887
|
+
})
|
|
936
888
|
}
|
|
937
889
|
}
|
|
890
|
+
/**
|
|
891
|
+
* Factory method to create a new React element. This no longer adheres to
|
|
892
|
+
* the class pattern, so do not use new to call it. Also, instanceof check
|
|
893
|
+
* will not work. Instead test $$typeof field against Symbol.for('react.element') to check
|
|
894
|
+
* if something is a React Element.
|
|
895
|
+
*
|
|
896
|
+
* @param {*} type
|
|
897
|
+
* @param {*} props
|
|
898
|
+
* @param {*} key
|
|
899
|
+
* @param {string|object} ref
|
|
900
|
+
* @param {*} owner
|
|
901
|
+
* @param {*} self A *temporary* helper to detect places where `this` is
|
|
902
|
+
* different from the `owner` when React.createElement is called, so that we
|
|
903
|
+
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
|
904
|
+
* functions, and as long as `this` and owner are the same, there will be no
|
|
905
|
+
* change in behavior.
|
|
906
|
+
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
|
907
|
+
* indicating filename, line number, and/or other information.
|
|
908
|
+
* @internal
|
|
909
|
+
*/
|
|
910
|
+
|
|
911
|
+
var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
912
|
+
var element = {
|
|
913
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
914
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
915
|
+
// Built-in properties that belong on the element
|
|
916
|
+
type: type,
|
|
917
|
+
key: key,
|
|
918
|
+
ref: ref,
|
|
919
|
+
props: props,
|
|
920
|
+
// Record the component responsible for creating this element.
|
|
921
|
+
_owner: owner,
|
|
922
|
+
}
|
|
938
923
|
|
|
939
|
-
|
|
940
|
-
|
|
924
|
+
{
|
|
925
|
+
// The validation flag is currently mutative. We put it on
|
|
926
|
+
// an external backing store so that we can freeze the whole object.
|
|
927
|
+
// This can be replaced with a WeakMap once they are implemented in
|
|
928
|
+
// commonly used development environments.
|
|
929
|
+
element._store = {} // To make comparing ReactElements easier for testing purposes, we make
|
|
930
|
+
// the validation flag non-enumerable (where possible, which should
|
|
931
|
+
// include every environment we run tests in), so the test framework
|
|
932
|
+
// ignores it.
|
|
933
|
+
|
|
934
|
+
Object.defineProperty(element._store, 'validated', {
|
|
935
|
+
configurable: false,
|
|
936
|
+
enumerable: false,
|
|
937
|
+
writable: true,
|
|
938
|
+
value: false,
|
|
939
|
+
}) // self and source are DEV only properties.
|
|
940
|
+
|
|
941
|
+
Object.defineProperty(element, '_self', {
|
|
942
|
+
configurable: false,
|
|
943
|
+
enumerable: false,
|
|
944
|
+
writable: false,
|
|
945
|
+
value: self,
|
|
946
|
+
}) // Two elements created in two different places should be considered
|
|
947
|
+
// equal for testing purposes and therefore we hide it from enumeration.
|
|
948
|
+
|
|
949
|
+
Object.defineProperty(element, '_source', {
|
|
950
|
+
configurable: false,
|
|
951
|
+
enumerable: false,
|
|
952
|
+
writable: false,
|
|
953
|
+
value: source,
|
|
954
|
+
})
|
|
941
955
|
|
|
942
|
-
|
|
943
|
-
|
|
956
|
+
if (Object.freeze) {
|
|
957
|
+
Object.freeze(element.props)
|
|
958
|
+
Object.freeze(element)
|
|
959
|
+
}
|
|
944
960
|
}
|
|
945
961
|
|
|
946
|
-
|
|
947
|
-
defineRefPropWarningGetter(props, displayName);
|
|
948
|
-
}
|
|
962
|
+
return element
|
|
949
963
|
}
|
|
964
|
+
/**
|
|
965
|
+
* https://github.com/reactjs/rfcs/pull/107
|
|
966
|
+
* @param {*} type
|
|
967
|
+
* @param {object} props
|
|
968
|
+
* @param {string} key
|
|
969
|
+
*/
|
|
970
|
+
|
|
971
|
+
function jsxDEV(type, config, maybeKey, source, self) {
|
|
972
|
+
{
|
|
973
|
+
var propName // Reserved names are extracted
|
|
974
|
+
|
|
975
|
+
var props = {}
|
|
976
|
+
var key = null
|
|
977
|
+
var ref = null // Currently, key can be spread in as a prop. This causes a potential
|
|
978
|
+
// issue if key is also explicitly declared (ie. <div {...props} key="Hi" />
|
|
979
|
+
// or <div key="Hi" {...props} /> ). We want to deprecate key spread,
|
|
980
|
+
// but as an intermediary step, we will use jsxDEV for everything except
|
|
981
|
+
// <div {...props} key="Hi" />, because we aren't currently able to tell if
|
|
982
|
+
// key is explicitly declared to be undefined or not.
|
|
983
|
+
|
|
984
|
+
if (maybeKey !== undefined) {
|
|
985
|
+
{
|
|
986
|
+
checkKeyStringCoercion(maybeKey)
|
|
987
|
+
}
|
|
950
988
|
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
}
|
|
989
|
+
key = '' + maybeKey
|
|
990
|
+
}
|
|
954
991
|
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
{
|
|
960
|
-
if (element) {
|
|
961
|
-
var owner = element._owner;
|
|
962
|
-
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
963
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
964
|
-
} else {
|
|
965
|
-
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
966
|
-
}
|
|
967
|
-
}
|
|
968
|
-
}
|
|
992
|
+
if (hasValidKey(config)) {
|
|
993
|
+
{
|
|
994
|
+
checkKeyStringCoercion(config.key)
|
|
995
|
+
}
|
|
969
996
|
|
|
970
|
-
|
|
997
|
+
key = '' + config.key
|
|
998
|
+
}
|
|
971
999
|
|
|
972
|
-
{
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
1000
|
+
if (hasValidRef(config)) {
|
|
1001
|
+
ref = config.ref
|
|
1002
|
+
warnIfStringRefCannotBeAutoConverted(config, self)
|
|
1003
|
+
} // Remaining properties are added to a new props object
|
|
1004
|
+
|
|
1005
|
+
for (propName in config) {
|
|
1006
|
+
if (
|
|
1007
|
+
hasOwnProperty.call(config, propName) &&
|
|
1008
|
+
!RESERVED_PROPS.hasOwnProperty(propName)
|
|
1009
|
+
) {
|
|
1010
|
+
props[propName] = config[propName]
|
|
1011
|
+
}
|
|
1012
|
+
} // Resolve default props
|
|
982
1013
|
|
|
1014
|
+
if (type && type.defaultProps) {
|
|
1015
|
+
var defaultProps = type.defaultProps
|
|
983
1016
|
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
}
|
|
1017
|
+
for (propName in defaultProps) {
|
|
1018
|
+
if (props[propName] === undefined) {
|
|
1019
|
+
props[propName] = defaultProps[propName]
|
|
1020
|
+
}
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
989
1023
|
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
|
|
1024
|
+
if (key || ref) {
|
|
1025
|
+
var displayName =
|
|
1026
|
+
typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type
|
|
994
1027
|
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
}
|
|
1028
|
+
if (key) {
|
|
1029
|
+
defineKeyPropWarningGetter(props, displayName)
|
|
1030
|
+
}
|
|
999
1031
|
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
}
|
|
1032
|
+
if (ref) {
|
|
1033
|
+
defineRefPropWarningGetter(props, displayName)
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1003
1036
|
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1037
|
+
return ReactElement(
|
|
1038
|
+
type,
|
|
1039
|
+
key,
|
|
1040
|
+
ref,
|
|
1041
|
+
self,
|
|
1042
|
+
source,
|
|
1043
|
+
ReactCurrentOwner.current,
|
|
1044
|
+
props
|
|
1045
|
+
)
|
|
1046
|
+
}
|
|
1010
1047
|
}
|
|
1011
1048
|
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
}
|
|
1015
|
-
/**
|
|
1016
|
-
* Warn if there's no key explicitly set on dynamic arrays of children or
|
|
1017
|
-
* object keys are not valid. This allows us to keep track of children between
|
|
1018
|
-
* updates.
|
|
1019
|
-
*/
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
var ownerHasKeyUseWarning = {};
|
|
1023
|
-
|
|
1024
|
-
function getCurrentComponentErrorInfo(parentType) {
|
|
1025
|
-
{
|
|
1026
|
-
var info = getDeclarationErrorAddendum();
|
|
1027
|
-
|
|
1028
|
-
if (!info) {
|
|
1029
|
-
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
|
1049
|
+
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner
|
|
1050
|
+
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame
|
|
1030
1051
|
|
|
1031
|
-
|
|
1032
|
-
|
|
1052
|
+
function setCurrentlyValidatingElement$1(element) {
|
|
1053
|
+
{
|
|
1054
|
+
if (element) {
|
|
1055
|
+
var owner = element._owner
|
|
1056
|
+
var stack = describeUnknownElementTypeFrameInDEV(
|
|
1057
|
+
element.type,
|
|
1058
|
+
element._source,
|
|
1059
|
+
owner ? owner.type : null
|
|
1060
|
+
)
|
|
1061
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(stack)
|
|
1062
|
+
} else {
|
|
1063
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(null)
|
|
1064
|
+
}
|
|
1033
1065
|
}
|
|
1034
1066
|
}
|
|
1035
1067
|
|
|
1036
|
-
|
|
1037
|
-
}
|
|
1038
|
-
}
|
|
1039
|
-
/**
|
|
1040
|
-
* Warn if the element doesn't have an explicit key assigned to it.
|
|
1041
|
-
* This element is in an array. The array could grow and shrink or be
|
|
1042
|
-
* reordered. All children that haven't already been validated are required to
|
|
1043
|
-
* have a "key" property assigned to it. Error statuses are cached so a warning
|
|
1044
|
-
* will only be shown once.
|
|
1045
|
-
*
|
|
1046
|
-
* @internal
|
|
1047
|
-
* @param {ReactElement} element Element that requires a key.
|
|
1048
|
-
* @param {*} parentType element's parent's type.
|
|
1049
|
-
*/
|
|
1050
|
-
|
|
1068
|
+
var propTypesMisspellWarningShown
|
|
1051
1069
|
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
if (!element._store || element._store.validated || element.key != null) {
|
|
1055
|
-
return;
|
|
1070
|
+
{
|
|
1071
|
+
propTypesMisspellWarningShown = false
|
|
1056
1072
|
}
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1073
|
+
/**
|
|
1074
|
+
* Verifies the object is a ReactElement.
|
|
1075
|
+
* See https://reactjs.org/docs/react-api.html#isvalidelement
|
|
1076
|
+
* @param {?object} object
|
|
1077
|
+
* @return {boolean} True if `object` is a ReactElement.
|
|
1078
|
+
* @final
|
|
1079
|
+
*/
|
|
1080
|
+
|
|
1081
|
+
function isValidElement(object) {
|
|
1082
|
+
{
|
|
1083
|
+
return (
|
|
1084
|
+
typeof object === 'object' &&
|
|
1085
|
+
object !== null &&
|
|
1086
|
+
object.$$typeof === REACT_ELEMENT_TYPE
|
|
1087
|
+
)
|
|
1088
|
+
}
|
|
1063
1089
|
}
|
|
1064
1090
|
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1091
|
+
function getDeclarationErrorAddendum() {
|
|
1092
|
+
{
|
|
1093
|
+
if (ReactCurrentOwner$1.current) {
|
|
1094
|
+
var name = getComponentNameFromType(ReactCurrentOwner$1.current.type)
|
|
1068
1095
|
|
|
1069
|
-
|
|
1096
|
+
if (name) {
|
|
1097
|
+
return '\n\nCheck the render method of `' + name + '`.'
|
|
1098
|
+
}
|
|
1099
|
+
}
|
|
1070
1100
|
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
|
1101
|
+
return ''
|
|
1102
|
+
}
|
|
1074
1103
|
}
|
|
1075
1104
|
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1105
|
+
function getSourceInfoErrorAddendum(source) {
|
|
1106
|
+
{
|
|
1107
|
+
if (source !== undefined) {
|
|
1108
|
+
var fileName = source.fileName.replace(/^.*[\\\/]/, '')
|
|
1109
|
+
var lineNumber = source.lineNumber
|
|
1110
|
+
return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.'
|
|
1111
|
+
}
|
|
1079
1112
|
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
}
|
|
1083
|
-
/**
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
* @internal
|
|
1089
|
-
* @param {ReactNode} node Statically passed child of any type.
|
|
1090
|
-
* @param {*} parentType node's parent's type.
|
|
1091
|
-
*/
|
|
1113
|
+
return ''
|
|
1114
|
+
}
|
|
1115
|
+
}
|
|
1116
|
+
/**
|
|
1117
|
+
* Warn if there's no key explicitly set on dynamic arrays of children or
|
|
1118
|
+
* object keys are not valid. This allows us to keep track of children between
|
|
1119
|
+
* updates.
|
|
1120
|
+
*/
|
|
1092
1121
|
|
|
1122
|
+
var ownerHasKeyUseWarning = {}
|
|
1093
1123
|
|
|
1094
|
-
function
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
return;
|
|
1098
|
-
}
|
|
1124
|
+
function getCurrentComponentErrorInfo(parentType) {
|
|
1125
|
+
{
|
|
1126
|
+
var info = getDeclarationErrorAddendum()
|
|
1099
1127
|
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1128
|
+
if (!info) {
|
|
1129
|
+
var parentName =
|
|
1130
|
+
typeof parentType === 'string'
|
|
1131
|
+
? parentType
|
|
1132
|
+
: parentType.displayName || parentType.name
|
|
1103
1133
|
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
}
|
|
1107
|
-
}
|
|
1108
|
-
} else if (isValidElement(node)) {
|
|
1109
|
-
// This element was passed in a valid location.
|
|
1110
|
-
if (node._store) {
|
|
1111
|
-
node._store.validated = true;
|
|
1112
|
-
}
|
|
1113
|
-
} else if (node) {
|
|
1114
|
-
var iteratorFn = getIteratorFn(node);
|
|
1115
|
-
|
|
1116
|
-
if (typeof iteratorFn === 'function') {
|
|
1117
|
-
// Entry iterators used to provide implicit keys,
|
|
1118
|
-
// but now we print a separate warning for them later.
|
|
1119
|
-
if (iteratorFn !== node.entries) {
|
|
1120
|
-
var iterator = iteratorFn.call(node);
|
|
1121
|
-
var step;
|
|
1122
|
-
|
|
1123
|
-
while (!(step = iterator.next()).done) {
|
|
1124
|
-
if (isValidElement(step.value)) {
|
|
1125
|
-
validateExplicitKey(step.value, parentType);
|
|
1126
|
-
}
|
|
1134
|
+
if (parentName) {
|
|
1135
|
+
info = '\n\nCheck the top-level render call using <' + parentName + '>.'
|
|
1127
1136
|
}
|
|
1128
1137
|
}
|
|
1138
|
+
|
|
1139
|
+
return info
|
|
1129
1140
|
}
|
|
1130
1141
|
}
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1142
|
+
/**
|
|
1143
|
+
* Warn if the element doesn't have an explicit key assigned to it.
|
|
1144
|
+
* This element is in an array. The array could grow and shrink or be
|
|
1145
|
+
* reordered. All children that haven't already been validated are required to
|
|
1146
|
+
* have a "key" property assigned to it. Error statuses are cached so a warning
|
|
1147
|
+
* will only be shown once.
|
|
1148
|
+
*
|
|
1149
|
+
* @internal
|
|
1150
|
+
* @param {ReactElement} element Element that requires a key.
|
|
1151
|
+
* @param {*} parentType element's parent's type.
|
|
1152
|
+
*/
|
|
1153
|
+
|
|
1154
|
+
function validateExplicitKey(element, parentType) {
|
|
1155
|
+
{
|
|
1156
|
+
if (!element._store || element._store.validated || element.key != null) {
|
|
1157
|
+
return
|
|
1158
|
+
}
|
|
1139
1159
|
|
|
1160
|
+
element._store.validated = true
|
|
1161
|
+
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType)
|
|
1140
1162
|
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1163
|
+
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
1164
|
+
return
|
|
1165
|
+
}
|
|
1144
1166
|
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1167
|
+
ownerHasKeyUseWarning[currentComponentErrorInfo] = true // Usually the current owner is the offender, but if it accepts children as a
|
|
1168
|
+
// property, it may be the creator of the child that's responsible for
|
|
1169
|
+
// assigning it a key.
|
|
1148
1170
|
|
|
1149
|
-
|
|
1171
|
+
var childOwner = ''
|
|
1150
1172
|
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
return;
|
|
1159
|
-
}
|
|
1173
|
+
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
|
|
1174
|
+
// Give the component that originally created this child.
|
|
1175
|
+
childOwner =
|
|
1176
|
+
' It was passed a child from ' +
|
|
1177
|
+
getComponentNameFromType(element._owner.type) +
|
|
1178
|
+
'.'
|
|
1179
|
+
}
|
|
1160
1180
|
|
|
1161
|
-
|
|
1162
|
-
// Intentionally inside to avoid triggering lazy initializers:
|
|
1163
|
-
var name = getComponentNameFromType(type);
|
|
1164
|
-
checkPropTypes(propTypes, element.props, 'prop', name, element);
|
|
1165
|
-
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
1166
|
-
propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
|
|
1181
|
+
setCurrentlyValidatingElement$1(element)
|
|
1167
1182
|
|
|
1168
|
-
|
|
1183
|
+
error(
|
|
1184
|
+
'Each child in a list should have a unique "key" prop.' +
|
|
1185
|
+
'%s%s See https://reactjs.org/link/warning-keys for more information.',
|
|
1186
|
+
currentComponentErrorInfo,
|
|
1187
|
+
childOwner
|
|
1188
|
+
)
|
|
1169
1189
|
|
|
1170
|
-
|
|
1190
|
+
setCurrentlyValidatingElement$1(null)
|
|
1191
|
+
}
|
|
1171
1192
|
}
|
|
1193
|
+
/**
|
|
1194
|
+
* Ensure that every element either is passed in a static location, in an
|
|
1195
|
+
* array with an explicit keys property defined, or in an object literal
|
|
1196
|
+
* with valid key property.
|
|
1197
|
+
*
|
|
1198
|
+
* @internal
|
|
1199
|
+
* @param {ReactNode} node Statically passed child of any type.
|
|
1200
|
+
* @param {*} parentType node's parent's type.
|
|
1201
|
+
*/
|
|
1202
|
+
|
|
1203
|
+
function validateChildKeys(node, parentType) {
|
|
1204
|
+
{
|
|
1205
|
+
if (typeof node !== 'object') {
|
|
1206
|
+
return
|
|
1207
|
+
}
|
|
1208
|
+
|
|
1209
|
+
if (isArray(node)) {
|
|
1210
|
+
for (var i = 0; i < node.length; i++) {
|
|
1211
|
+
var child = node[i]
|
|
1172
1212
|
|
|
1173
|
-
|
|
1174
|
-
|
|
1213
|
+
if (isValidElement(child)) {
|
|
1214
|
+
validateExplicitKey(child, parentType)
|
|
1215
|
+
}
|
|
1216
|
+
}
|
|
1217
|
+
} else if (isValidElement(node)) {
|
|
1218
|
+
// This element was passed in a valid location.
|
|
1219
|
+
if (node._store) {
|
|
1220
|
+
node._store.validated = true
|
|
1221
|
+
}
|
|
1222
|
+
} else if (node) {
|
|
1223
|
+
var iteratorFn = getIteratorFn(node)
|
|
1224
|
+
|
|
1225
|
+
if (typeof iteratorFn === 'function') {
|
|
1226
|
+
// Entry iterators used to provide implicit keys,
|
|
1227
|
+
// but now we print a separate warning for them later.
|
|
1228
|
+
if (iteratorFn !== node.entries) {
|
|
1229
|
+
var iterator = iteratorFn.call(node)
|
|
1230
|
+
var step
|
|
1231
|
+
|
|
1232
|
+
while (!(step = iterator.next()).done) {
|
|
1233
|
+
if (isValidElement(step.value)) {
|
|
1234
|
+
validateExplicitKey(step.value, parentType)
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1175
1241
|
}
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1242
|
+
/**
|
|
1243
|
+
* Given an element, validate that its props follow the propTypes definition,
|
|
1244
|
+
* provided by the type.
|
|
1245
|
+
*
|
|
1246
|
+
* @param {ReactElement} element
|
|
1247
|
+
*/
|
|
1248
|
+
|
|
1249
|
+
function validatePropTypes(element) {
|
|
1250
|
+
{
|
|
1251
|
+
var type = element.type
|
|
1182
1252
|
|
|
1253
|
+
if (type === null || type === undefined || typeof type === 'string') {
|
|
1254
|
+
return
|
|
1255
|
+
}
|
|
1183
1256
|
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1257
|
+
var propTypes
|
|
1258
|
+
|
|
1259
|
+
if (typeof type === 'function') {
|
|
1260
|
+
propTypes = type.propTypes
|
|
1261
|
+
} else if (
|
|
1262
|
+
typeof type === 'object' &&
|
|
1263
|
+
(type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
1264
|
+
// Inner props are checked in the reconciler.
|
|
1265
|
+
type.$$typeof === REACT_MEMO_TYPE)
|
|
1266
|
+
) {
|
|
1267
|
+
propTypes = type.propTypes
|
|
1268
|
+
} else {
|
|
1269
|
+
return
|
|
1270
|
+
}
|
|
1187
1271
|
|
|
1188
|
-
|
|
1189
|
-
|
|
1272
|
+
if (propTypes) {
|
|
1273
|
+
// Intentionally inside to avoid triggering lazy initializers:
|
|
1274
|
+
var name = getComponentNameFromType(type)
|
|
1275
|
+
checkPropTypes(propTypes, element.props, 'prop', name, element)
|
|
1276
|
+
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
1277
|
+
propTypesMisspellWarningShown = true // Intentionally inside to avoid triggering lazy initializers:
|
|
1190
1278
|
|
|
1191
|
-
|
|
1192
|
-
setCurrentlyValidatingElement$1(fragment);
|
|
1279
|
+
var _name = getComponentNameFromType(type)
|
|
1193
1280
|
|
|
1194
|
-
|
|
1281
|
+
error(
|
|
1282
|
+
'Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?',
|
|
1283
|
+
_name || 'Unknown'
|
|
1284
|
+
)
|
|
1285
|
+
}
|
|
1195
1286
|
|
|
1196
|
-
|
|
1197
|
-
|
|
1287
|
+
if (
|
|
1288
|
+
typeof type.getDefaultProps === 'function' &&
|
|
1289
|
+
!type.getDefaultProps.isReactClassApproved
|
|
1290
|
+
) {
|
|
1291
|
+
error(
|
|
1292
|
+
'getDefaultProps is only used on classic React.createClass ' +
|
|
1293
|
+
'definitions. Use a static property named `defaultProps` instead.'
|
|
1294
|
+
)
|
|
1295
|
+
}
|
|
1198
1296
|
}
|
|
1199
1297
|
}
|
|
1298
|
+
/**
|
|
1299
|
+
* Given a fragment, validate that it can only be provided with fragment props
|
|
1300
|
+
* @param {ReactElement} fragment
|
|
1301
|
+
*/
|
|
1200
1302
|
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
error('Invalid attribute `ref` supplied to `React.Fragment`.');
|
|
1303
|
+
function validateFragmentProps(fragment) {
|
|
1304
|
+
{
|
|
1305
|
+
var keys = Object.keys(fragment.props)
|
|
1205
1306
|
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
}
|
|
1209
|
-
}
|
|
1307
|
+
for (var i = 0; i < keys.length; i++) {
|
|
1308
|
+
var key = keys[i]
|
|
1210
1309
|
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
{
|
|
1214
|
-
var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
|
|
1215
|
-
// succeed and there will likely be errors in render.
|
|
1310
|
+
if (key !== 'children' && key !== 'key') {
|
|
1311
|
+
setCurrentlyValidatingElement$1(fragment)
|
|
1216
1312
|
|
|
1217
|
-
|
|
1218
|
-
|
|
1313
|
+
error(
|
|
1314
|
+
'Invalid prop `%s` supplied to `React.Fragment`. ' +
|
|
1315
|
+
'React.Fragment can only have `key` and `children` props.',
|
|
1316
|
+
key
|
|
1317
|
+
)
|
|
1219
1318
|
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1319
|
+
setCurrentlyValidatingElement$1(null)
|
|
1320
|
+
break
|
|
1321
|
+
}
|
|
1322
|
+
}
|
|
1223
1323
|
|
|
1224
|
-
|
|
1324
|
+
if (fragment.ref !== null) {
|
|
1325
|
+
setCurrentlyValidatingElement$1(fragment)
|
|
1225
1326
|
|
|
1226
|
-
|
|
1227
|
-
info += sourceInfo;
|
|
1228
|
-
} else {
|
|
1229
|
-
info += getDeclarationErrorAddendum();
|
|
1230
|
-
}
|
|
1327
|
+
error('Invalid attribute `ref` supplied to `React.Fragment`.')
|
|
1231
1328
|
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
if (type === null) {
|
|
1235
|
-
typeString = 'null';
|
|
1236
|
-
} else if (isArray(type)) {
|
|
1237
|
-
typeString = 'array';
|
|
1238
|
-
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
1239
|
-
typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
|
|
1240
|
-
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
1241
|
-
} else {
|
|
1242
|
-
typeString = typeof type;
|
|
1329
|
+
setCurrentlyValidatingElement$1(null)
|
|
1330
|
+
}
|
|
1243
1331
|
}
|
|
1244
|
-
|
|
1245
|
-
error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
|
|
1246
1332
|
}
|
|
1247
1333
|
|
|
1248
|
-
var
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1334
|
+
var didWarnAboutKeySpread = {}
|
|
1335
|
+
function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
|
1336
|
+
{
|
|
1337
|
+
var validType = isValidElementType(type) // We warn in this case but don't throw. We expect the element creation to
|
|
1338
|
+
// succeed and there will likely be errors in render.
|
|
1339
|
+
|
|
1340
|
+
if (!validType) {
|
|
1341
|
+
var info = ''
|
|
1342
|
+
|
|
1343
|
+
if (
|
|
1344
|
+
type === undefined ||
|
|
1345
|
+
(typeof type === 'object' && type !== null && Object.keys(type).length === 0)
|
|
1346
|
+
) {
|
|
1347
|
+
info +=
|
|
1348
|
+
' You likely forgot to export your component from the file ' +
|
|
1349
|
+
"it's defined in, or you might have mixed up default and named imports."
|
|
1350
|
+
}
|
|
1258
1351
|
|
|
1352
|
+
var sourceInfo = getSourceInfoErrorAddendum(source)
|
|
1259
1353
|
|
|
1260
|
-
|
|
1261
|
-
|
|
1354
|
+
if (sourceInfo) {
|
|
1355
|
+
info += sourceInfo
|
|
1356
|
+
} else {
|
|
1357
|
+
info += getDeclarationErrorAddendum()
|
|
1358
|
+
}
|
|
1262
1359
|
|
|
1263
|
-
|
|
1264
|
-
if (isStaticChildren) {
|
|
1265
|
-
if (isArray(children)) {
|
|
1266
|
-
for (var i = 0; i < children.length; i++) {
|
|
1267
|
-
validateChildKeys(children[i], type);
|
|
1268
|
-
}
|
|
1360
|
+
var typeString
|
|
1269
1361
|
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1362
|
+
if (type === null) {
|
|
1363
|
+
typeString = 'null'
|
|
1364
|
+
} else if (isArray(type)) {
|
|
1365
|
+
typeString = 'array'
|
|
1366
|
+
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
1367
|
+
typeString = '<' + (getComponentNameFromType(type.type) || 'Unknown') + ' />'
|
|
1368
|
+
info = ' Did you accidentally export a JSX literal instead of a component?'
|
|
1273
1369
|
} else {
|
|
1274
|
-
|
|
1370
|
+
typeString = typeof type
|
|
1275
1371
|
}
|
|
1276
|
-
} else {
|
|
1277
|
-
validateChildKeys(children, type);
|
|
1278
|
-
}
|
|
1279
|
-
}
|
|
1280
|
-
}
|
|
1281
1372
|
|
|
1282
|
-
|
|
1283
|
-
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1373
|
+
error(
|
|
1374
|
+
'React.jsx: type is invalid -- expected a string (for ' +
|
|
1375
|
+
'built-in components) or a class/function (for composite ' +
|
|
1376
|
+
'components) but got: %s.%s',
|
|
1377
|
+
typeString,
|
|
1378
|
+
info
|
|
1379
|
+
)
|
|
1380
|
+
}
|
|
1289
1381
|
|
|
1290
|
-
|
|
1291
|
-
|
|
1382
|
+
var element = jsxDEV(type, props, key, source, self) // The result can be nullish if a mock or a custom function is used.
|
|
1383
|
+
// TODO: Drop this when these are no longer allowed as the type argument.
|
|
1384
|
+
|
|
1385
|
+
if (element == null) {
|
|
1386
|
+
return element
|
|
1387
|
+
} // Skip key warning if the type isn't valid since our key validation logic
|
|
1388
|
+
// doesn't expect a non-string/function type and can throw confusing errors.
|
|
1389
|
+
// We don't want exception behavior to differ between dev and prod.
|
|
1390
|
+
// (Rendering will throw with a helpful message and as soon as the type is
|
|
1391
|
+
// fixed, the key warnings will appear.)
|
|
1392
|
+
|
|
1393
|
+
if (validType) {
|
|
1394
|
+
var children = props.children
|
|
1395
|
+
|
|
1396
|
+
if (children !== undefined) {
|
|
1397
|
+
if (isStaticChildren) {
|
|
1398
|
+
if (isArray(children)) {
|
|
1399
|
+
for (var i = 0; i < children.length; i++) {
|
|
1400
|
+
validateChildKeys(children[i], type)
|
|
1401
|
+
}
|
|
1292
1402
|
|
|
1293
|
-
|
|
1403
|
+
if (Object.freeze) {
|
|
1404
|
+
Object.freeze(children)
|
|
1405
|
+
}
|
|
1406
|
+
} else {
|
|
1407
|
+
error(
|
|
1408
|
+
'React.jsx: Static children should always be an array. ' +
|
|
1409
|
+
'You are likely explicitly calling React.jsxs or React.jsxDEV. ' +
|
|
1410
|
+
'Use the Babel transform instead.'
|
|
1411
|
+
)
|
|
1412
|
+
}
|
|
1413
|
+
} else {
|
|
1414
|
+
validateChildKeys(children, type)
|
|
1415
|
+
}
|
|
1416
|
+
}
|
|
1417
|
+
}
|
|
1294
1418
|
|
|
1295
|
-
|
|
1419
|
+
{
|
|
1420
|
+
if (hasOwnProperty.call(props, 'key')) {
|
|
1421
|
+
var componentName = getComponentNameFromType(type)
|
|
1422
|
+
var keys = Object.keys(props).filter(function (k) {
|
|
1423
|
+
return k !== 'key'
|
|
1424
|
+
})
|
|
1425
|
+
var beforeExample =
|
|
1426
|
+
keys.length > 0
|
|
1427
|
+
? '{key: someKey, ' + keys.join(': ..., ') + ': ...}'
|
|
1428
|
+
: '{key: someKey}'
|
|
1429
|
+
|
|
1430
|
+
if (!didWarnAboutKeySpread[componentName + beforeExample]) {
|
|
1431
|
+
var afterExample =
|
|
1432
|
+
keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}'
|
|
1433
|
+
|
|
1434
|
+
error(
|
|
1435
|
+
'A props object containing a "key" prop is being spread into JSX:\n' +
|
|
1436
|
+
' let props = %s;\n' +
|
|
1437
|
+
' <%s {...props} />\n' +
|
|
1438
|
+
'React keys must be passed directly to JSX without using spread:\n' +
|
|
1439
|
+
' let props = %s;\n' +
|
|
1440
|
+
' <%s key={someKey} {...props} />',
|
|
1441
|
+
beforeExample,
|
|
1442
|
+
componentName,
|
|
1443
|
+
afterExample,
|
|
1444
|
+
componentName
|
|
1445
|
+
)
|
|
1446
|
+
|
|
1447
|
+
didWarnAboutKeySpread[componentName + beforeExample] = true
|
|
1448
|
+
}
|
|
1449
|
+
}
|
|
1296
1450
|
}
|
|
1297
|
-
}
|
|
1298
|
-
}
|
|
1299
1451
|
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1452
|
+
if (type === REACT_FRAGMENT_TYPE) {
|
|
1453
|
+
validateFragmentProps(element)
|
|
1454
|
+
} else {
|
|
1455
|
+
validatePropTypes(element)
|
|
1456
|
+
}
|
|
1305
1457
|
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
} // These two functions exist to still get child warnings in dev
|
|
1458
|
+
return element
|
|
1459
|
+
}
|
|
1460
|
+
} // These two functions exist to still get child warnings in dev
|
|
1309
1461
|
|
|
1310
|
-
var jsxDEV$1 =
|
|
1462
|
+
var jsxDEV$1 = jsxWithValidation
|
|
1311
1463
|
|
|
1312
|
-
exports.Fragment = REACT_FRAGMENT_TYPE
|
|
1313
|
-
exports.jsxDEV = jsxDEV$1
|
|
1314
|
-
})()
|
|
1464
|
+
exports.Fragment = REACT_FRAGMENT_TYPE
|
|
1465
|
+
exports.jsxDEV = jsxDEV$1
|
|
1466
|
+
})()
|
|
1315
1467
|
}
|