GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Throw a better error when Lazy/Promise is used in React.Children by sebmarkbage · Pull Request #28280 · react/react

Conversation

@sebmarkbage

@sebmarkbage sebmarkbage commented Feb 8, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

We could in theory actually support this case by throwing a Promise when it's used inside a render. Allowing it to be synchronously unwrapped. However, it's a bit sketchy because we officially only support this in the render's child position or in use().

Another alternative could be to actually pass the Promise/Lazy to the callback so that you can reason about it and just return it again or even unwrapping with use() - at least for the forEach case maybe.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@sebmarkbage
sebmarkbage requested review from acdlite and gnoff February 8, 2024 21:36
@facebook-github-bot facebook-github-bot added CLA Signed React Core Team Opened by a member of the React Core Team labels Feb 8, 2024
@react-sizebot

react-sizebot commented Feb 8, 2024 •
edited
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown

Comparing: d3def47...56ade53

Critical size changes

Includes critical production bundles, as well as any change greater than 2%:

Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable/react-dom/cjs/react-dom.production.min.js = 176.64 kB 176.64 kB = 55.02 kB 55.02 kB
oss-experimental/react-dom/cjs/react-dom.production.min.js = 178.63 kB 178.63 kB = 55.59 kB 55.59 kB
facebook-www/ReactDOM-prod.classic.js = 591.73 kB 591.73 kB = 104.44 kB 104.44 kB
facebook-www/ReactDOM-prod.modern.js = 575.51 kB 575.51 kB = 101.53 kB 101.53 kB
oss-stable-semver/react/cjs/react.production.min.js +4.70% 8.06 kB 8.44 kB +3.16% 3.11 kB 3.20 kB
oss-stable/react/cjs/react.production.min.js +4.69% 8.09 kB 8.47 kB +3.10% 3.13 kB 3.23 kB
oss-experimental/react/cjs/react.production.min.js +4.20% 9.02 kB 9.40 kB +2.72% 3.42 kB 3.51 kB
oss-stable-semver/react/umd/react.profiling.min.js +3.21% 11.86 kB 12.24 kB +2.27% 4.63 kB 4.74 kB
oss-stable-semver/react/umd/react.production.min.js +3.20% 11.86 kB 12.24 kB +2.27% 4.63 kB 4.74 kB
oss-stable/react/umd/react.profiling.min.js +3.20% 11.88 kB 12.26 kB +2.28% 4.65 kB 4.76 kB
oss-stable/react/umd/react.production.min.js +3.20% 11.88 kB 12.26 kB +2.28% 4.65 kB 4.76 kB
oss-experimental/react/umd/react.profiling.min.js +2.98% 12.75 kB 13.13 kB +1.74% 4.94 kB 5.02 kB
oss-experimental/react/umd/react.production.min.js +2.98% 12.75 kB 13.13 kB +1.74% 4.94 kB 5.02 kB
facebook-react-native/react/cjs/React-prod.js +2.64% 17.68 kB 18.15 kB +2.14% 4.63 kB 4.73 kB
facebook-react-native/react/cjs/React-profiling.js +2.61% 17.82 kB 18.29 kB +2.12% 4.62 kB 4.72 kB
facebook-www/React-prod.modern.js +2.54% 18.36 kB 18.83 kB +2.06% 4.71 kB 4.81 kB
facebook-www/React-prod.classic.js +2.50% 18.66 kB 19.12 kB +2.02% 4.80 kB 4.90 kB
facebook-www/React-profiling.modern.js +2.48% 18.80 kB 19.26 kB +2.00% 4.80 kB 4.89 kB
facebook-www/React-profiling.classic.js +2.44% 19.09 kB 19.56 kB +2.01% 4.88 kB 4.98 kB
test_utils/ReactAllWarnings.js Deleted 67.02 kB 0.00 kB Deleted 16.42 kB 0.00 kB

Significant size changes

Includes any change greater than 0.2%:

Expand to show
Name +/- Base Current +/- gzip Base gzip Current gzip
oss-stable-semver/react/cjs/react.production.min.js +4.70% 8.06 kB 8.44 kB +3.16% 3.11 kB 3.20 kB
oss-stable/react/cjs/react.production.min.js +4.69% 8.09 kB 8.47 kB +3.10% 3.13 kB 3.23 kB
oss-experimental/react/cjs/react.production.min.js +4.20% 9.02 kB 9.40 kB +2.72% 3.42 kB 3.51 kB
oss-stable-semver/react/umd/react.profiling.min.js +3.21% 11.86 kB 12.24 kB +2.27% 4.63 kB 4.74 kB
oss-stable-semver/react/umd/react.production.min.js +3.20% 11.86 kB 12.24 kB +2.27% 4.63 kB 4.74 kB
oss-stable/react/umd/react.profiling.min.js +3.20% 11.88 kB 12.26 kB +2.28% 4.65 kB 4.76 kB
oss-stable/react/umd/react.production.min.js +3.20% 11.88 kB 12.26 kB +2.28% 4.65 kB 4.76 kB
oss-experimental/react/umd/react.profiling.min.js +2.98% 12.75 kB 13.13 kB +1.74% 4.94 kB 5.02 kB
oss-experimental/react/umd/react.production.min.js +2.98% 12.75 kB 13.13 kB +1.74% 4.94 kB 5.02 kB
facebook-react-native/react/cjs/React-prod.js +2.64% 17.68 kB 18.15 kB +2.14% 4.63 kB 4.73 kB
facebook-react-native/react/cjs/React-profiling.js +2.61% 17.82 kB 18.29 kB +2.12% 4.62 kB 4.72 kB
facebook-www/React-prod.modern.js +2.54% 18.36 kB 18.83 kB +2.06% 4.71 kB 4.81 kB
facebook-www/React-prod.classic.js +2.50% 18.66 kB 19.12 kB +2.02% 4.80 kB 4.90 kB
facebook-www/React-profiling.modern.js +2.48% 18.80 kB 19.26 kB +2.00% 4.80 kB 4.89 kB
facebook-www/React-profiling.classic.js +2.44% 19.09 kB 19.56 kB +2.01% 4.88 kB 4.98 kB
oss-stable-semver/react/cjs/react.production.js +1.39% 34.85 kB 35.34 kB +0.95% 9.67 kB 9.77 kB
oss-stable/react/cjs/react.production.js +1.38% 34.88 kB 35.36 kB +0.96% 9.70 kB 9.80 kB
oss-experimental/react/cjs/react.production.js +1.29% 37.49 kB 37.97 kB +0.88% 10.35 kB 10.44 kB
oss-stable-semver/react/cjs/react.react-server.production.min.js +1.23% 6.99 kB 7.07 kB +0.71% 2.98 kB 3.00 kB
oss-stable/react/cjs/react.react-server.production.min.js +1.23% 7.01 kB 7.10 kB +0.73% 3.00 kB 3.02 kB
facebook-www/ReactServer-prod.modern.js +1.14% 14.90 kB 15.07 kB +0.63% 3.99 kB 4.01 kB
oss-experimental/react/cjs/react.react-server.production.min.js +0.95% 9.04 kB 9.12 kB +0.63% 3.68 kB 3.70 kB
oss-stable-semver/react/cjs/react.react-server.production.js +0.72% 29.99 kB 30.21 kB +0.35% 8.94 kB 8.97 kB
oss-stable/react/cjs/react.react-server.production.js +0.72% 30.02 kB 30.23 kB +0.35% 8.96 kB 9.00 kB
oss-stable-semver/react/cjs/react.react-server.development.js +0.62% 77.60 kB 78.08 kB +0.42% 21.43 kB 21.52 kB
oss-stable/react/cjs/react.react-server.development.js +0.62% 77.62 kB 78.10 kB +0.42% 21.46 kB 21.55 kB
oss-experimental/react/cjs/react.react-server.production.js +0.60% 36.11 kB 36.32 kB +0.29% 10.61 kB 10.64 kB
oss-experimental/react/cjs/react.react-server.development.js +0.57% 84.05 kB 84.53 kB +0.39% 23.31 kB 23.40 kB
facebook-www/ReactServer-dev.modern.js +0.56% 108.25 kB 108.86 kB +0.41% 26.29 kB 26.40 kB
facebook-react-native/react/cjs/React-dev.js +0.48% 127.74 kB 128.34 kB +0.35% 30.89 kB 31.00 kB
oss-stable-semver/react/cjs/react.development.js +0.47% 101.86 kB 102.34 kB +0.33% 27.21 kB 27.30 kB
oss-stable/react/cjs/react.development.js +0.47% 101.89 kB 102.37 kB +0.34% 27.24 kB 27.33 kB
oss-experimental/react/cjs/react.development.js +0.46% 104.42 kB 104.91 kB +0.33% 27.88 kB 27.97 kB
facebook-www/React-dev.modern.js +0.43% 140.57 kB 141.18 kB +0.33% 34.21 kB 34.33 kB
facebook-www/React-dev.classic.js +0.43% 141.79 kB 142.40 kB +0.30% 34.47 kB 34.57 kB
oss-stable-semver/react/umd/react.development.js +0.40% 124.92 kB 125.42 kB +0.29% 31.92 kB 32.01 kB
oss-stable/react/umd/react.development.js +0.40% 124.95 kB 125.44 kB +0.29% 31.95 kB 32.04 kB
oss-experimental/react/umd/react.development.js +0.39% 127.59 kB 128.09 kB +0.32% 32.63 kB 32.73 kB
test_utils/ReactAllWarnings.js Deleted 67.02 kB 0.00 kB Deleted 16.42 kB 0.00 kB

Generated by 🚫 dangerJS against 56ade53

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@sebmarkbage
Throw a better error when Lazy/Promise is used in React.Children
56ade53
@sebmarkbage
sebmarkbage force-pushed the childrenerror branch from 0e25345 to 56ade53 Compare February 8, 2024 21:46
gnoff
gnoff reviewed Feb 8, 2024
View reviewed changes
Comment thread packages/react/src/ReactChildren.js
Comment on lines +108 to +112
case REACT_LAZY_TYPE:
throw new Error(
'Cannot render an Async Component, Promise or React.Lazy inside React.Children. ' +
'We recommend not iterating over children and just rendering them plain.',
);

@gnoff gnoff Feb 8, 2024

Copy link
Copy Markdown
Collaborator

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This makes it an error to iterate over Children if any child happens to be one of these things but you may not know that until you iterate over it. Basically it makes using Children risky if you don't control the inputs very carefully. The language here says you can't render but forEach allows you to do arbitrary stuff with the child so perhaps you will omit any non-renderable children.

This feels halfway towards deprecating React.Children but where you may learn about it in painful ways

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions

@sebmarkbage sebmarkbage Feb 8, 2024

Copy link
Copy Markdown
Contributor Author

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To be clear this is already going to error below so it's not a new change. It's just a better message.

The thing is that you can't omit the lazy because if you did something with an element you should've done it with the unwrapped lazy.

But yea, we've already effectively deprecated React.Children. We're just ambivalent about it.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

gnoff reacted with thumbs up emoji
All reactions
  • 👍 1 reaction
gnoff
gnoff approved these changes Feb 8, 2024
View reviewed changes
@sebmarkbage
sebmarkbage merged commit e41ee9e into react:main Feb 8, 2024
github-actions Bot pushed a commit that referenced this pull request Feb 8, 2024
@sebmarkbage
Throw a better error when Lazy/Promise is used in React.Children (#28280
64de3b0
)

We could in theory actually support this case by throwing a Promise when
it's used inside a render. Allowing it to be synchronously unwrapped.
However, it's a bit sketchy because we officially only support this in
the render's child position or in `use()`.

Another alternative could be to actually pass the Promise/Lazy to the
callback so that you can reason about it and just return it again or
even unwrapping with `use()` - at least for the forEach case maybe.

DiffTrain build for [e41ee9e](e41ee9e)
@ztanner ztanner mentioned this pull request Feb 9, 2024
Update React from 2bc7d336a to ba5e6a832 vercel/next.js#61837
Merged
@sebmarkbage sebmarkbage mentioned this pull request Feb 9, 2024
Suspend Thenable/Lazy if it's used in React.Children and unwrap #28284
Merged
huozhi pushed a commit to vercel/next.js that referenced this pull request Feb 9, 2024
@ztanner
Update React from 2bc7d336a to ba5e6a832 (#61837)
f165514
Updates React from 2bc7d336a to ba5e6a832.

### React upstream changes

- react/react#28283
- react/react#28280
- react/react#28079
- react/react#28233
- react/react#28276
- react/react#28272
- react/react#28265
- react/react#28259
- react/react#28153
- react/react#28246
- react/react#28218
- react/react#28263
- react/react#28257
- react/react#28261
- react/react#28262
- react/react#28260
- react/react#28258
- react/react#27864
- react/react#28254
- react/react#28219
- react/react#28248
- react/react#28216
- react/react#28249
- react/react#28241
- react/react#28243
- react/react#28253
- react/react#28256
- react/react#28236
- react/react#28237
- react/react#28242
- react/react#28251
- react/react#28252

Closes NEXT-2411
sebmarkbage added a commit that referenced this pull request Feb 12, 2024
@sebmarkbage
Suspend Thenable/Lazy if it's used in React.Children and unwrap (#28284)
9e7944f
This pains me because `React.Children` is really already
pseudo-deprecated.

`React.Children` takes any children that `React.Node` takes. We now
support Lazy and Thenable in this position elsewhere, but it errors in
`React.Children`.

This becomes an issue with async Server Components which can resolve
into a Lazy and in the future Lazy will just become Thenables. Which
causes this to error.

There are a few different semantics we could have:

1) Error like we already do (#28280). `React.Children` is about
introspecting children. It was always sketchy because you can't
introspect inside an abstraction anyway. With Server Components we fold
away the components so you can actually introspect inside of them kind
of but what they do is an implementation detail and you should be able
to turn it into a Client Component at any point. The type of an Element
passing the boundary actually reduces to `React.Node`.
2) Suspend and unwrap the Node (this PR). If we assume that Children is
called inside of render, then throwing a Promise if it's not already
loaded or unwrapping would treat it as if it wasn't there. Just like if
you rendered it in React. This lets you introspect what's inside which
isn't really something you should be able to do. This isn't compatible
with deprecating throwing-a-Promise and enable static compilation like
`use()` does. We'd have to deprecate `React.Children` before doing that
which we might anyway.
3) Wrap in a Fragment. If a Server Component was instead a Client
Component, you couldn't introspect through it anyway. Another
alternative might be to let it pass through but then it wouldn't be
given a flat key. We could also wrap it in a Fragment that is keyed.
That way you're always seeing an element. The issue with this solution
is that it wouldn't see the key of the Server Component since that gets
forwarded to the child that is yet to resolve. The nice thing about that
strategy is it doesn't depend on throw-a-Promise but it might not be
keyed correctly when things move.
github-actions Bot pushed a commit that referenced this pull request Feb 12, 2024
@sebmarkbage
Suspend Thenable/Lazy if it's used in React.Children and unwrap (#28284)
23457ab
This pains me because `React.Children` is really already
pseudo-deprecated.

`React.Children` takes any children that `React.Node` takes. We now
support Lazy and Thenable in this position elsewhere, but it errors in
`React.Children`.

This becomes an issue with async Server Components which can resolve
into a Lazy and in the future Lazy will just become Thenables. Which
causes this to error.

There are a few different semantics we could have:

1) Error like we already do (#28280). `React.Children` is about
introspecting children. It was always sketchy because you can't
introspect inside an abstraction anyway. With Server Components we fold
away the components so you can actually introspect inside of them kind
of but what they do is an implementation detail and you should be able
to turn it into a Client Component at any point. The type of an Element
passing the boundary actually reduces to `React.Node`.
2) Suspend and unwrap the Node (this PR). If we assume that Children is
called inside of render, then throwing a Promise if it's not already
loaded or unwrapping would treat it as if it wasn't there. Just like if
you rendered it in React. This lets you introspect what's inside which
isn't really something you should be able to do. This isn't compatible
with deprecating throwing-a-Promise and enable static compilation like
`use()` does. We'd have to deprecate `React.Children` before doing that
which we might anyway.
3) Wrap in a Fragment. If a Server Component was instead a Client
Component, you couldn't introspect through it anyway. Another
alternative might be to let it pass through but then it wouldn't be
given a flat key. We could also wrap it in a Fragment that is keyed.
That way you're always seeing an element. The issue with this solution
is that it wouldn't see the key of the Server Component since that gets
forwarded to the child that is yet to resolve. The nice thing about that
strategy is it doesn't depend on throw-a-Promise but it might not be
keyed correctly when things move.

DiffTrain build for [9e7944f](9e7944f)
@ztanner ztanner mentioned this pull request Mar 19, 2024
(backport) Update React from 60a927d04 to 14898b6a9 vercel/next.js#63442
Closed
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
@sebmarkbage @AndyPengc12
Throw a better error when Lazy/Promise is used in React.Children (rea…
7a98d96
…ct#28280)

We could in theory actually support this case by throwing a Promise when
it's used inside a render. Allowing it to be synchronously unwrapped.
However, it's a bit sketchy because we officially only support this in
the render's child position or in `use()`.

Another alternative could be to actually pass the Promise/Lazy to the
callback so that you can reason about it and just return it again or
even unwrapping with `use()` - at least for the forEach case maybe.
EdisonVan pushed a commit to EdisonVan/react that referenced this pull request Apr 15, 2024
@sebmarkbage @AndyPengc12
Suspend Thenable/Lazy if it's used in React.Children and unwrap (reac…
d96c091
…t#28284)

This pains me because `React.Children` is really already
pseudo-deprecated.

`React.Children` takes any children that `React.Node` takes. We now
support Lazy and Thenable in this position elsewhere, but it errors in
`React.Children`.

This becomes an issue with async Server Components which can resolve
into a Lazy and in the future Lazy will just become Thenables. Which
causes this to error.

There are a few different semantics we could have:

1) Error like we already do (react#28280). `React.Children` is about
introspecting children. It was always sketchy because you can't
introspect inside an abstraction anyway. With Server Components we fold
away the components so you can actually introspect inside of them kind
of but what they do is an implementation detail and you should be able
to turn it into a Client Component at any point. The type of an Element
passing the boundary actually reduces to `React.Node`.
2) Suspend and unwrap the Node (this PR). If we assume that Children is
called inside of render, then throwing a Promise if it's not already
loaded or unwrapping would treat it as if it wasn't there. Just like if
you rendered it in React. This lets you introspect what's inside which
isn't really something you should be able to do. This isn't compatible
with deprecating throwing-a-Promise and enable static compilation like
`use()` does. We'd have to deprecate `React.Children` before doing that
which we might anyway.
3) Wrap in a Fragment. If a Server Component was instead a Client
Component, you couldn't introspect through it anyway. Another
alternative might be to let it pass through but then it wouldn't be
given a flat key. We could also wrap it in a Fragment that is keyed.
That way you're always seeing an element. The issue with this solution
is that it wouldn't see the key of the Server Component since that gets
forwarded to the child that is yet to resolve. The nice thing about that
strategy is it doesn't depend on throw-a-Promise but it might not be
keyed correctly when things move.
bigfootjon pushed a commit that referenced this pull request Apr 18, 2024
@sebmarkbage
Throw a better error when Lazy/Promise is used in React.Children (#28280
f47b316
)

We could in theory actually support this case by throwing a Promise when
it's used inside a render. Allowing it to be synchronously unwrapped.
However, it's a bit sketchy because we officially only support this in
the render's child position or in `use()`.

Another alternative could be to actually pass the Promise/Lazy to the
callback so that you can reason about it and just return it again or
even unwrapping with `use()` - at least for the forEach case maybe.

DiffTrain build for commit e41ee9e.
bigfootjon pushed a commit that referenced this pull request Apr 18, 2024
@sebmarkbage
Suspend Thenable/Lazy if it's used in React.Children and unwrap (#28284)
1739b31
This pains me because `React.Children` is really already
pseudo-deprecated.

`React.Children` takes any children that `React.Node` takes. We now
support Lazy and Thenable in this position elsewhere, but it errors in
`React.Children`.

This becomes an issue with async Server Components which can resolve
into a Lazy and in the future Lazy will just become Thenables. Which
causes this to error.

There are a few different semantics we could have:

1) Error like we already do (#28280). `React.Children` is about
introspecting children. It was always sketchy because you can't
introspect inside an abstraction anyway. With Server Components we fold
away the components so you can actually introspect inside of them kind
of but what they do is an implementation detail and you should be able
to turn it into a Client Component at any point. The type of an Element
passing the boundary actually reduces to `React.Node`.
2) Suspend and unwrap the Node (this PR). If we assume that Children is
called inside of render, then throwing a Promise if it's not already
loaded or unwrapping would treat it as if it wasn't there. Just like if
you rendered it in React. This lets you introspect what's inside which
isn't really something you should be able to do. This isn't compatible
with deprecating throwing-a-Promise and enable static compilation like
`use()` does. We'd have to deprecate `React.Children` before doing that
which we might anyway.
3) Wrap in a Fragment. If a Server Component was instead a Client
Component, you couldn't introspect through it anyway. Another
alternative might be to let it pass through but then it wouldn't be
given a flat key. We could also wrap it in a Fragment that is keyed.
That way you're always seeing an element. The issue with this solution
is that it wouldn't see the key of the Server Component since that gets
forwarded to the child that is yet to resolve. The nice thing about that
strategy is it doesn't depend on throw-a-Promise but it might not be
keyed correctly when things move.

DiffTrain build for commit 9e7944f.
hanzo-dev pushed a commit to hanzoai/react that referenced this pull request Sep 9, 2026
@sebmarkbage
Throw a better error when Lazy/Promise is used in React.Children (rea…
548db9c
…ct#28280)

We could in theory actually support this case by throwing a Promise when
it's used inside a render. Allowing it to be synchronously unwrapped.
However, it's a bit sketchy because we officially only support this in
the render's child position or in `use()`.

Another alternative could be to actually pass the Promise/Lazy to the
callback so that you can reason about it and just return it again or
even unwrapping with `use()` - at least for the forEach case maybe.
hanzo-dev pushed a commit to hanzoai/react that referenced this pull request Sep 9, 2026
@sebmarkbage
Suspend Thenable/Lazy if it's used in React.Children and unwrap (reac…
79bff6b
…t#28284)

This pains me because `React.Children` is really already
pseudo-deprecated.

`React.Children` takes any children that `React.Node` takes. We now
support Lazy and Thenable in this position elsewhere, but it errors in
`React.Children`.

This becomes an issue with async Server Components which can resolve
into a Lazy and in the future Lazy will just become Thenables. Which
causes this to error.

There are a few different semantics we could have:

1) Error like we already do (react#28280). `React.Children` is about
introspecting children. It was always sketchy because you can't
introspect inside an abstraction anyway. With Server Components we fold
away the components so you can actually introspect inside of them kind
of but what they do is an implementation detail and you should be able
to turn it into a Client Component at any point. The type of an Element
passing the boundary actually reduces to `React.Node`.
2) Suspend and unwrap the Node (this PR). If we assume that Children is
called inside of render, then throwing a Promise if it's not already
loaded or unwrapping would treat it as if it wasn't there. Just like if
you rendered it in React. This lets you introspect what's inside which
isn't really something you should be able to do. This isn't compatible
with deprecating throwing-a-Promise and enable static compilation like
`use()` does. We'd have to deprecate `React.Children` before doing that
which we might anyway.
3) Wrap in a Fragment. If a Server Component was instead a Client
Component, you couldn't introspect through it anyway. Another
alternative might be to let it pass through but then it wouldn't be
given a flat key. We could also wrap it in a Fragment that is keyed.
That way you're always seeing an element. The issue with this solution
is that it wouldn't see the key of the Server Component since that gets
forwarded to the child that is yet to resolve. The nice thing about that
strategy is it doesn't depend on throw-a-Promise but it might not be
keyed correctly when things move.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@gnoff gnoff gnoff approved these changes
@acdlite acdlite Awaiting requested review from acdlite

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

CLA Signed React Core Team Opened by a member of the React Core Team

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

4 participants

@sebmarkbage @react-sizebot @gnoff @facebook-github-bot
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.