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

[ESLint] Disallow hooks in async functions #27045

Merged
merged 1 commit into from
Jul 5, 2023

Commits on Jul 3, 2023

  1. [ESLint] Disallow hooks in async functions

    Hooks cannot be called in async functions, on either the client or the
    server. This mistake sometimes happens when using Server Components,
    especially when refactoring a Server Component to a Client Component.
    
    React logs a warning at runtime, but it's even better to catch this with
    a lint rule since it will show immediate inline feedback in the editor.
    
    I added this to the existing "Rules of Hooks" ESLint rule.
    acdlite committed Jul 3, 2023
    Configuration menu
    Copy the full SHA
    bc484bd View commit details
    Browse the repository at this point in the history