ESLint has a comprehensive set of rules for JavaScript code that cover stylistic choices and prevent common bugs. The rules are discussed in detail in the React documentation, but there are two rules that must be followed when using Hooks. Action buttons that are not intended to submit a form should have a type attribute. When no type is specified, a button defaults to a type of submit. If an optional prop is not passed to a component, it will be undefined.
Table of contents
IntroductionReact Hooks rules ( eslint-plugin-react-hooks )React rules ( eslint-plugin-react )Over 200k developers use LogRocket to create better digital experiencesWrapping upFull visibility into production React apps3 Comments
Sort: