Files
react/scripts
Andrew Clark 5c8dabf886 Detect and warn about native async function components in development (#27031)
Adds a development warning to complement the error introduced by
https://github.com/facebook/react/pull/27019.

We can detect and warn about async client components by checking the
prototype of the function. This won't work for environments where async
functions are transpiled, but for native async functions, it allows us
to log an earlier warning during development, including in cases that
don't trigger the infinite loop guard added in
https://github.com/facebook/react/pull/27019. It does not supersede the
infinite loop guard, though, because that mechanism also prevents the
app from crashing.

I also added a warning for calling a hook inside an async function. This
one fires even during a transition. We could add a corresponding warning
to Flight, since hooks are not allowed in async Server Components,
either. (Though in both environments, this is better handled by a lint
rule.)
2023-07-01 22:44:41 -04:00
..
2023-01-31 08:25:05 -05:00
2023-01-31 08:25:05 -05:00
2023-06-16 09:57:03 -04:00
2023-01-31 08:25:05 -05:00
2023-01-31 08:25:05 -05:00
2013-09-09 23:42:54 -07:00