@umijs/renderer-react 4.0.0-canary.20230109.1 → 4.0.0-canary.20230201.2
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/browser.js +4 -4
- package/dist/link.d.ts +1 -1
- package/dist/link.js +8 -3
- package/dist/routes.js +3 -3
- package/dist/server.js +3 -3
- package/dist/withRouter.js +1 -1
- package/package.json +2 -2
package/dist/browser.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
3
|
-
import _createForOfIteratorHelper from "@babel/runtime/helpers/createForOfIteratorHelper";
|
|
4
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/esm/defineProperty";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
+
import _createForOfIteratorHelper from "@babel/runtime/helpers/esm/createForOfIteratorHelper";
|
|
4
|
+
import _slicedToArray from "@babel/runtime/helpers/esm/slicedToArray";
|
|
5
5
|
import React, { useCallback, useEffect, useLayoutEffect, useState } from 'react'; // compatible with < react@18 in @umijs/preset-umi/src/features/react
|
|
6
6
|
|
|
7
7
|
import { HelmetProvider } from 'react-helmet-async';
|
package/dist/link.d.ts
CHANGED
|
@@ -2,4 +2,4 @@ import React, { PropsWithChildren } from 'react';
|
|
|
2
2
|
import { LinkProps } from 'react-router-dom';
|
|
3
3
|
export declare function LinkWithPrefetch(props: PropsWithChildren<{
|
|
4
4
|
prefetch?: boolean;
|
|
5
|
-
} & LinkProps & React.RefAttributes<HTMLAnchorElement>>): JSX.Element;
|
|
5
|
+
} & LinkProps & React.RefAttributes<HTMLAnchorElement>>): JSX.Element | null;
|
package/dist/link.js
CHANGED
|
@@ -1,15 +1,20 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
1
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
3
3
|
var _excluded = ["prefetch"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { Link } from 'react-router-dom';
|
|
6
6
|
import { useAppData } from "./appContext";
|
|
7
7
|
export function LinkWithPrefetch(props) {
|
|
8
|
+
var _props$to;
|
|
9
|
+
|
|
8
10
|
var prefetch = props.prefetch,
|
|
9
11
|
linkProps = _objectWithoutProperties(props, _excluded);
|
|
10
12
|
|
|
11
13
|
var appData = useAppData();
|
|
12
|
-
var to = typeof props.to === 'string' ? props.to : props.to.pathname;
|
|
14
|
+
var to = typeof props.to === 'string' ? props.to : (_props$to = props.to) === null || _props$to === void 0 ? void 0 : _props$to.pathname; // compatible with old code
|
|
15
|
+
// which to might be undefined
|
|
16
|
+
|
|
17
|
+
if (!to) return null;
|
|
13
18
|
return /*#__PURE__*/React.createElement(Link, _extends({
|
|
14
19
|
onMouseEnter: function onMouseEnter() {
|
|
15
20
|
var _appData$preloadRoute;
|
package/dist/routes.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
-
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
1
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/esm/extends";
|
|
3
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
4
4
|
var _excluded = ["redirect"];
|
|
5
5
|
// @ts-ignore
|
|
6
6
|
import React from 'react';
|
package/dist/server.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import _regeneratorRuntime from "@babel/runtime/helpers/regeneratorRuntime";
|
|
2
|
-
import _objectSpread from "@babel/runtime/helpers/objectSpread2";
|
|
3
|
-
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
1
|
+
import _regeneratorRuntime from "@babel/runtime/helpers/esm/regeneratorRuntime";
|
|
2
|
+
import _objectSpread from "@babel/runtime/helpers/esm/objectSpread2";
|
|
3
|
+
import _asyncToGenerator from "@babel/runtime/helpers/esm/asyncToGenerator";
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { HelmetProvider } from 'react-helmet-async';
|
|
6
6
|
import { StaticRouter } from 'react-router-dom/server';
|
package/dist/withRouter.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umijs/renderer-react",
|
|
3
|
-
"version": "4.0.0-canary.
|
|
3
|
+
"version": "4.0.0-canary.20230201.2",
|
|
4
4
|
"description": "@umijs/renderer-react",
|
|
5
5
|
"homepage": "https://github.com/umijs/umi/tree/master/packages/renderer-react#readme",
|
|
6
6
|
"bugs": "https://github.com/umijs/umi/issues",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"test": "umi-scripts jest-turbo"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@babel/runtime": "7.
|
|
25
|
+
"@babel/runtime": "7.20.7",
|
|
26
26
|
"@loadable/component": "5.15.2",
|
|
27
27
|
"history": "5.3.0",
|
|
28
28
|
"react-helmet-async": "1.3.0",
|