Skip to content

Review accessing state inside of setting state #1992

Open
@interactivellama

Description

@interactivellama

Currently MenuDropdown and Combobox are accessing the current state this.state in order to set a new state.

The correct procedure should be to use a callback:
https://medium.com/@voonminghann/when-to-use-callback-function-of-setstate-in-react-37fff67e5a6c

this.setState((prevState) => ({
	isOpen: !prevState.isOpen,
}));

Search for // eslint-disable-next-line react/no-access-state-in-setstate in order to fix this issue.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions