Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[React 19] React compiler strips await from for await loops #29113

Closed
yepitschunked opened this issue May 16, 2024 · 2 comments
Closed

[React 19] React compiler strips await from for await loops #29113

yepitschunked opened this issue May 16, 2024 · 2 comments

Comments

@yepitschunked
Copy link

yepitschunked commented May 16, 2024

Summary

React compiler is compiling

async function MyApp({ something }) {
  for await (const deferredState of foo) {
    // do stuff
  }
}

into

async function MyApp(t0) {
  for (const deferredState of foo) {
  }
}

i.e the for await became a regular for.

https://playground.react.dev/#N4Igzg9grgTgxgUxALhAQzATwHZwAQBmUuALgJYTZ4CymAggA4MAUwekAtgiQBZnYBzPAF8AlHmAAdKoQgw8aAO5oyJPMziUwagCYICCGDAQ6AyiTQkEeCAVkRxUmXjwB6V3h0R2JKAQLSLsLSwdggwkA

@josephsavona
Copy link
Contributor

Thanks for the heads up!

@josephsavona
Copy link
Contributor

Fixed, thanks again for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants