You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
here, isControlled and isOn are destructured state properties.
TypeError: Cannot read properties of undefined (reading 'references')
Occurred while linting /Users/ygenin/src/pillar/src/datagrid/implementation/filtering/filterEditors/DateFilterEditor.tsx:57
Rule: "react/no-unused-state"
at PropertyDefinition, ClassProperty (/Users/ygenin/src/pillar/node_modules/eslint-plugin-react/lib/rules/no-unused-state.js:388:34)
Expected Behavior
The eslint rule should handle the code without crashing.
The issue seems to be that the stateArg.name on the line below is undefined whereas it is expected to be 'state' or some other name if destructuring is not used.
Is there an existing issue for this?
Description Overview
When the prev state parameter (second parameter) of
getDerivedStateFromProps
is destructured in-place, the rulereact/no-unused-state
crashesstatic getDerivedStateFromProps = ({value, disableAnimation}: ToggleProps, {isControlled, isOn}: ToggleState) => {
here,
isControlled
andisOn
are destructured state properties.Expected Behavior
The eslint rule should handle the code without crashing.
The issue seems to be that the stateArg.name on the line below is undefined whereas it is expected to be 'state' or some other name if destructuring is not used.
eslint-plugin-react version
7.32.2
eslint version
8.2.0
node version
18.12.1
The text was updated successfully, but these errors were encountered: