Grundsätze und Regeln von Hooks
npm install --save-dev eslint-plugin-react-hooksyarn add --dev eslint-plugin-react-hooks{
"plugins": [
// ...
"react-hooks"
],
"rules": {
// ...
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn"
}
}Die Regeln von Hooks
Hooks können nur in React Function Components verwendet werden!
Hooks dürfen nur auf oberster Ebene innerhalb ihrer Function Component verwendet werden!
Last updated