File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -293,6 +293,18 @@ function shouldRevalidate({ actionStatus, defaultShouldRevalidate }) {
293
293
}
294
294
```
295
295
296
+ ## Deprecations
297
+
298
+ The ` json ` and ` defer ` methods are deprecated in favor of returning raw objects.
299
+
300
+ ``` diff
301
+ async function loader() {
302
+ - return json({ data });
303
+ + return { data };
304
+ ```
305
+
306
+ If you were using ` json ` to serialize your data to JSON, you can use the native [ Response.json()] [ response-json ] method instead.
307
+
296
308
## Upgrade to v7
297
309
298
310
Now that your app is caught up, you can simply update to v7 (theoretically!) without issue.
@@ -354,3 +366,5 @@ Note you should use a top-level import for non-DOM contexts, such as Jest tests:
354
366
Congratulations, you're now on v7!
355
367
356
368
[ react-flushsync ] : https://react.dev/reference/react-dom/flushSync
369
+ [ response-json ] : https://developer.mozilla.org/en-US/docs/Web/API/Response/json
370
+ [ data-util ] : https://api.reactrouter.com/v7/functions/react_router.data.html
You can’t perform that action at this time.
0 commit comments