We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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-hooks/prefer-use-state-lazy-initialization
Disallow function calls in useState that aren't wrapped in an initializer function:
useState
// Bad const [value, setValue] = useState(generateTodos()); // Good const [value, setValue] = useState(() => generateTodos());
Port jsx-eslint/eslint-plugin-react#3579
No response
The text was updated successfully, but these errors were encountered:
Looks good.
Sorry, something went wrong.
prefer-use-state-lazy-initialization
fa76901
No branches or pull requests
Describe the problem
Disallow function calls in
useState
that aren't wrapped in an initializer function:Describe the solution you'd like
Port jsx-eslint/eslint-plugin-react#3579
Alternatives considered
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: