miral 0.0.8 → 0.0.9
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/Viewer.js +4 -2
- package/package.json +1 -1
package/dist/Viewer.js
CHANGED
|
@@ -169,11 +169,13 @@ const Catalog = () => {
|
|
|
169
169
|
? assetsEntry
|
|
170
170
|
: (entries.find((item) => item.path === url.searchParams.get("component")) ?? entries[0]);
|
|
171
171
|
const example = url.searchParams.get("example") || "Preview";
|
|
172
|
+
const pendingPage = entry && entry !== assetsEntry ? loadPage(entry.path) : null;
|
|
173
|
+
const deferredPage = React.useDeferredValue(pendingPage);
|
|
172
174
|
let page = emptyPage;
|
|
173
175
|
if (entry === assetsEntry)
|
|
174
176
|
page = assetsPage;
|
|
175
|
-
else if (
|
|
176
|
-
page = React.use(
|
|
177
|
+
else if (deferredPage)
|
|
178
|
+
page = React.use(deferredPage);
|
|
177
179
|
const [values, setValues] = React.useState(() => readValues(page, url));
|
|
178
180
|
const [previousUrl, setPreviousUrl] = React.useState(url);
|
|
179
181
|
if (previousUrl !== url) {
|