@shuvi/platform-web 1.0.42 → 1.0.44
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.
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { useMatchedRoute } from '@shuvi/router-react';
|
|
2
2
|
import { loaderModel, loaderModelName } from '@shuvi/platform-shared/shared';
|
|
3
3
|
import { useStaticModel } from './store';
|
|
4
|
-
export const noLoaderMessage = 'Warning: no loader found. Please make sure the page component where `useLoaderData` is called has a `loader` export.';
|
|
5
4
|
const hasOwn = Object.prototype.hasOwnProperty;
|
|
6
5
|
export const useLoaderData = () => {
|
|
7
6
|
const currentMatch = useMatchedRoute();
|
|
@@ -10,7 +9,7 @@ export const useLoaderData = () => {
|
|
|
10
9
|
// matched route
|
|
11
10
|
const loaderData = useStaticModel(loaderModelName, loaderModel);
|
|
12
11
|
if (!hasOwn.call(loaderData.dataByRouteId, id)) {
|
|
13
|
-
throw Error(
|
|
12
|
+
throw Error(`Loader data not found for route "${currentMatch.route.path}". Please make sure the page component where \`useLoaderData\` is called has a \`loader\` export.`);
|
|
14
13
|
}
|
|
15
14
|
return loaderData.dataByRouteId[id];
|
|
16
15
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@shuvi/platform-web",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.44",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/shuvijs/shuvi.git",
|
|
@@ -72,15 +72,15 @@
|
|
|
72
72
|
},
|
|
73
73
|
"dependencies": {
|
|
74
74
|
"@next/react-refresh-utils": "12.1.6",
|
|
75
|
-
"@shuvi/error-overlay": "1.0.
|
|
76
|
-
"@shuvi/hook": "1.0.
|
|
77
|
-
"@shuvi/platform-shared": "1.0.
|
|
78
|
-
"@shuvi/router": "1.0.
|
|
79
|
-
"@shuvi/router-react": "1.0.
|
|
80
|
-
"@shuvi/runtime": "1.0.
|
|
81
|
-
"@shuvi/shared": "1.0.
|
|
82
|
-
"@shuvi/toolpack": "1.0.
|
|
83
|
-
"@shuvi/utils": "1.0.
|
|
75
|
+
"@shuvi/error-overlay": "1.0.44",
|
|
76
|
+
"@shuvi/hook": "1.0.44",
|
|
77
|
+
"@shuvi/platform-shared": "1.0.44",
|
|
78
|
+
"@shuvi/router": "1.0.44",
|
|
79
|
+
"@shuvi/router-react": "1.0.44",
|
|
80
|
+
"@shuvi/runtime": "1.0.44",
|
|
81
|
+
"@shuvi/shared": "1.0.44",
|
|
82
|
+
"@shuvi/toolpack": "1.0.44",
|
|
83
|
+
"@shuvi/utils": "1.0.44",
|
|
84
84
|
"content-type": "1.0.4",
|
|
85
85
|
"core-js": "3.6.5",
|
|
86
86
|
"doura": "0.0.13",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"whatwg-fetch": "3.0.0"
|
|
99
99
|
},
|
|
100
100
|
"peerDependencies": {
|
|
101
|
-
"@shuvi/service": "1.0.
|
|
101
|
+
"@shuvi/service": "1.0.44"
|
|
102
102
|
},
|
|
103
103
|
"devDependencies": {
|
|
104
104
|
"@shuvi/service": "workspace:*",
|