Skip to content

Commit 7c0bfde

Browse files
committed
Merge branch 'release-next' into dev
2 parents f5f7511 + 3a66719 commit 7c0bfde

File tree

18 files changed

+430
-356
lines changed

18 files changed

+430
-356
lines changed

.changeset/cwv-report-id.md

-6
This file was deleted.

.changeset/static-context-error-status-code.md

-5
This file was deleted.

.changeset/throw-abort-reason.md

-7
This file was deleted.

CHANGELOG.md

+129-94
Large diffs are not rendered by default.

docs/guides/ssr.md

+7
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ app.get("*", async (req, res) => {
139139
});
140140
```
141141

142+
<docs-info>We use [`renderToString`][rendertostring] here for simplicity since we've already loaded our data in `handler.query` and we're not using any streaming features in this simple example. If you need to support streaming features, you would need to use [`renderToPipeableStream`][rendertopipeablestream].<br/><br/>If you wish to support [`defer`][defer], you will also need to manage serializing the server-side Promises over the wire to the client (hint, just use [Remix][remix] where this is handled for you via the `Scripts` component 😉).</docs-info>
143+
142144
Once we've sent the HTML back to the browser, we'll need to "hydrate" the application on the client using `createBrowserRouter()` and `<RouterProvider>`:
143145

144146
```jsx filename=entry-client.jsx lines=[10-15]
@@ -280,6 +282,8 @@ app.get("*", (req, res) => {
280282
app.listen(3000);
281283
```
282284
285+
<docs-info>We use [`renderToString`][rendertostring] here for simplicity since we're not using any streaming features in this simple example. If you need to support streaming features, you would need to use [`renderToPipeableStream`][rendertopipeablestream].</docs-info>
286+
283287
And finally, you'll need a similar file to "hydrate" the app with your JavaScript bundle that includes the very same `App` component. Note the use of `BrowserRouter` instead of `StaticRouter`.
284288
285289
```js filename=client.entry.js
@@ -320,3 +324,6 @@ Again, we recommend you give [Remix](https://remix.run) a look. It's the best wa
320324
[hydration]: https://react.dev/reference/react-dom/client/hydrateRoot
321325
[hydrate-false]: ../routers/static-router-provider#hydrate
322326
[partialhydration]: ../routers/create-browser-router#partial-hydration-data
327+
[rendertostring]: https://react.dev/reference/react-dom/server/renderToString
328+
[rendertopipeablestream]: https://react.dev/reference/react-dom/server/renderToPipeableStream
329+
[defer]: https://reactrouter.com/en/main/utils/defer

docs/upgrading/v5.md

+5
Original file line numberDiff line numberDiff line change
@@ -947,8 +947,13 @@ const match = matchPath(
947947

948948
`<Prompt>` from v5 (along with `usePrompt` and `useBlocker` from the v6 betas) are not included in the current released version of v6. We decided we'd rather ship with what we have than take even more time to nail down a feature that isn't fully baked. We will absolutely be working on adding this back in to v6 at some point in the near future, but not for our first stable release of 6.x.
949949

950+
<docs-info>We have since added implementations for [`useBlocker`][useblocker] and [`unstable_usePrompt`][useprompt] that you can use instead of `<Prompt>`</docs-info>
951+
950952
## What did we miss?
951953

952954
Despite our best attempts at being thorough, it's very likely that we missed something. If you follow this upgrade guide and find that to be the case, please let us know. We are happy to help you figure out what to do with your v5 code to be able to upgrade and take advantage of all of the cool stuff in v6.
953955

954956
Good luck 🤘
957+
958+
[useblocker]: ../hooks/use-blocker
959+
[useprompt]: ../hooks/use-prompt

0 commit comments

Comments
 (0)