From 5c3f3cd105492f987685f06819522b7ce30f08df Mon Sep 17 00:00:00 2001 From: Andrew Clark Date: Sat, 11 Mar 2023 17:45:15 -0500 Subject: [PATCH] [Flight fixtures] Remove redundant `use` Now that promises are renderable nodes, we can remove the `use` call from the root of the Flight fixture. Uncached promises will likely be accompanied by a warning when they are rendered outside a transition. But this promise is the result of a Flight response, so it's cached. And it's also a rendered as part of a transition. So it's fine. Indeed, this is the canonical way to use this feature. --- fixtures/flight/src/index.js | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/fixtures/flight/src/index.js b/fixtures/flight/src/index.js index b8ef94844f2a5..77461a258a0e3 100644 --- a/fixtures/flight/src/index.js +++ b/fixtures/flight/src/index.js @@ -27,12 +27,7 @@ let data = createFromFetch( } ); -// TODO: Once not needed once children can be promises. -function Content() { - return React.use(data); -} - // TODO: This transition shouldn't really be necessary but it is for now. React.startTransition(() => { - ReactDOM.hydrateRoot(document, ); + ReactDOM.hydrateRoot(document, data); });