You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Throw a better error when Lazy/Promise is used in React.Children (facebook#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.
Copy file name to clipboardexpand all lines: scripts/error-codes/codes.json
+2-1
Original file line number
Diff line number
Diff line change
@@ -489,5 +489,6 @@
489
489
"501": "The render was aborted with postpone when the shell is incomplete. Reason: %s",
490
490
"502": "Cannot read a Client Context from a Server Component.",
491
491
"503": "Cannot use() an already resolved Client Reference.",
492
-
"504": "Failed to read a RSC payload created by a development version of React on the server while using a production version on the client. Always use matching versions on the server and the client."
492
+
"504": "Failed to read a RSC payload created by a development version of React on the server while using a production version on the client. Always use matching versions on the server and the client.",
493
+
"505": "Cannot render an Async Component, Promise or React.Lazy inside React.Children. We recommend not iterating over children and just rendering them plain."
0 commit comments