Skip to content

Commit 56a3c18

Browse files
authored
[Flight fixture] Remove redundant use (#26373)
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.
1 parent 6bd53a5 commit 56a3c18

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

fixtures/flight/src/index.js

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,7 @@ let data = createFromFetch(
2727
}
2828
);
2929

30-
// TODO: Once not needed once children can be promises.
31-
function Content() {
32-
return React.use(data);
33-
}
34-
3530
// TODO: This transition shouldn't really be necessary but it is for now.
3631
React.startTransition(() => {
37-
ReactDOM.hydrateRoot(document, <Content />);
32+
ReactDOM.hydrateRoot(document, data);
3833
});

0 commit comments

Comments
 (0)