什么是“react/no-unused-state”,为什么不好?

What is `react/no-unused-state` and why is it bad?

有人可以准确解释 no-unused-state 的含义以及为什么它被认为是不好的做法吗?

除了摘自 commit 的以下句子外,我似乎找不到任何信息:

This adds a new rule, react/no-unused-state, which discovers state fields in a React component and warns if any of them are never read.

The eslint-plugin-react docs 举例说明什么是好代码,什么是坏代码。

如果您在未使用的组件中保留状态,则您在您的应用程序中包含了无用的代码。

这反过来会带来一大堆问题,包括您交付的代码实际上从未经过测试,您必须维护没有带来任何好处的代码等。