react-router 0.0.0-experimental-3e5084cc → 0.0.0-experimental-8f9ef191

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/index.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /**
2
- * React Router v0.0.0-experimental-3e5084cc
2
+ * React Router v0.0.0-experimental-8f9ef191
3
3
  *
4
4
  * Copyright (c) Remix Software Inc.
5
5
  *
@@ -538,14 +538,14 @@ function _renderMatches(matches, parentMatches, dataRouterState, future) {
538
538
  }
539
539
 
540
540
  // If we're in a partial hydration mode, detect if we need to render down to
541
- // a given InitialFallback while we load the rest of the hydration data
541
+ // a given HydrateFallback while we load the rest of the hydration data
542
542
  let renderFallback = false;
543
543
  let fallbackIndex = -1;
544
544
  if (dataRouterState && future && future.v7_partialHydration) {
545
545
  for (let i = 0; i < renderedMatches.length; i++) {
546
546
  let match = renderedMatches[i];
547
547
  // Track the deepest fallback up until the first route without data
548
- if (match.route.InitialFallback || match.route.initialFallbackElement) {
548
+ if (match.route.HydrateFallback || match.route.hydrateFallbackElement) {
549
549
  fallbackIndex = i;
550
550
  }
551
551
  if (match.route.loader && match.route.id && dataRouterState.loaderData[match.route.id] === undefined && (!dataRouterState.errors || dataRouterState.errors[match.route.id] === undefined)) {
@@ -565,20 +565,20 @@ function _renderMatches(matches, parentMatches, dataRouterState, future) {
565
565
  return renderedMatches.reduceRight((outlet, match, index) => {
566
566
  // Only data routers handle errors/fallbacks
567
567
  let error;
568
- let shouldRenderInitialFallback = false;
568
+ let shouldRenderHydrateFallback = false;
569
569
  let errorElement = null;
570
- let initialFallbackElement = null;
570
+ let hydrateFallbackElement = null;
571
571
  if (dataRouterState) {
572
572
  error = errors && match.route.id ? errors[match.route.id] : null;
573
573
  errorElement = match.route.errorElement || defaultErrorElement;
574
574
  if (renderFallback) {
575
575
  if (fallbackIndex < 0 && index === 0) {
576
- warningOnce("route-fallback", false, "No `InitialFallback` element provided to render during initial hydration");
577
- shouldRenderInitialFallback = true;
578
- initialFallbackElement = null;
576
+ warningOnce("route-fallback", false, "No `HydrateFallback` element provided to render during initial hydration");
577
+ shouldRenderHydrateFallback = true;
578
+ hydrateFallbackElement = null;
579
579
  } else if (fallbackIndex === index) {
580
- shouldRenderInitialFallback = true;
581
- initialFallbackElement = match.route.initialFallbackElement || null;
580
+ shouldRenderHydrateFallback = true;
581
+ hydrateFallbackElement = match.route.hydrateFallbackElement || null;
582
582
  }
583
583
  }
584
584
  }
@@ -587,8 +587,8 @@ function _renderMatches(matches, parentMatches, dataRouterState, future) {
587
587
  let children;
588
588
  if (error) {
589
589
  children = errorElement;
590
- } else if (shouldRenderInitialFallback) {
591
- children = initialFallbackElement;
590
+ } else if (shouldRenderHydrateFallback) {
591
+ children = hydrateFallbackElement;
592
592
  } else if (match.route.Component) {
593
593
  // Note: This is a de-optimized path since React won't re-use the
594
594
  // ReactElement since it's identity changes with each new
@@ -1368,15 +1368,15 @@ function mapRouteProperties(route) {
1368
1368
  Component: undefined
1369
1369
  });
1370
1370
  }
1371
- if (route.InitialFallback) {
1371
+ if (route.HydrateFallback) {
1372
1372
  if (process.env.NODE_ENV !== "production") {
1373
- if (route.initialFallbackElement) {
1374
- process.env.NODE_ENV !== "production" ? UNSAFE_warning(false, "You should not include both `InitialFallback` and `initialFallbackElement` on your route - " + "`InitialFallback` will be used.") : void 0;
1373
+ if (route.hydrateFallbackElement) {
1374
+ process.env.NODE_ENV !== "production" ? UNSAFE_warning(false, "You should not include both `HydrateFallback` and `hydrateFallbackElement` on your route - " + "`HydrateFallback` will be used.") : void 0;
1375
1375
  }
1376
1376
  }
1377
1377
  Object.assign(updates, {
1378
- initialFallbackElement: /*#__PURE__*/React.createElement(route.InitialFallback),
1379
- InitialFallback: undefined
1378
+ hydrateFallbackElement: /*#__PURE__*/React.createElement(route.HydrateFallback),
1379
+ HydrateFallback: undefined
1380
1380
  });
1381
1381
  }
1382
1382
  if (route.ErrorBoundary) {