You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix: keep loaderData as promises and track values internally
* chore: rename <Deferred> -> <Await>
* chore: rename useDeferredData -> useAwaitedData
* bundle bump
* Fix up example of raw promise
* clean up await error boundary
* fix: cancel fetcher deferred loads on revalidations
* Handle fetcher deferred rejections at error boundaries
* change Await prop from value -> promise
* Add changeset
* Add test for not proying settled values through
* Add tests for raw promises and <Await>
* Handle raw values with Await
* add useAsyncError, support raw objects, stop supporting arrays and single promises
* deferred() -> defer()
* change <Await promise> to <Await resolve>
* bump bundle
* Remove defer utility in favor of naked objects
* Clean up test
* Revert "Remove defer utility in favor of naked objects"
This reverts commit 3fd7850.
* disbale auto tracking on naked objects
* useRouteError => useAsyncError in changesets
* add rejection code path to raw Await example
Copy file name to clipboardExpand all lines: .changeset/light-months-argue.md
+21-21Lines changed: 21 additions & 21 deletions
Original file line number
Diff line number
Diff line change
@@ -3,46 +3,46 @@
3
3
"@remix-run/router": patch
4
4
---
5
5
6
-
Feat: adds `deferred` support to data routers
6
+
Feat: adds `defer()` support to data routers
7
7
8
-
Returning a `deferred` from a `loader` allows you to separate _critical_ loader data that you want to wait for prior to rendering the destination page from _non-critical_ data that you are OK to show a spinner for until it loads.
8
+
Returning a `defer()` from a `loader` allows you to separate _critical_ loader data that you want to wait for prior to rendering the destination page from _non-critical_ data that you are OK to show a spinner for until it loads.
9
9
10
10
```jsx
11
-
// In your route loader, return a deferred() and choose per-key whether to
11
+
// In your route loader, return a defer() and choose per-key whether to
12
12
// await the promise or not. As soon as the awaited promises resolve, the
13
13
// page will be rendered.
14
14
functionloader() {
15
-
returndeferred({
15
+
returndefer({
16
16
critical:awaitgetCriticalData(),
17
17
lazy:getLazyData(),
18
18
});
19
19
};
20
20
21
21
// In your route element, grab the values from useLoaderData and render them
22
-
// with <Deferred> inside a <Suspense> boundary
23
-
functionDeferredPage() {
22
+
// with <Await> inside a <React.Suspense> boundary
0 commit comments