I am not saying Don't use state. My intention is to reduce the usage of useState where ever it is unnecessary and one more if we are working in any react project which is in mature state there we cannot change the tech-stack so at-least we can improve it by doing few things like this.
On one hand, you're reducing the usage of state, on the other you're making it harder for other maintainers, if there are any. Especially if there are side effects that should influence the state (e.g. a server-side confirmation about the toggle), you'll switch back to state anyways.
You still have a point: don't overuse state - and make your state as dumb as possible. It'll save trouble in the long run.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
I am not saying Don't use state. My intention is to reduce the usage of
useState
where ever it is unnecessary and one more if we are working in any react project which is in mature state there we cannot change the tech-stack so at-least we can improve it by doing few things like this.On one hand, you're reducing the usage of state, on the other you're making it harder for other maintainers, if there are any. Especially if there are side effects that should influence the state (e.g. a server-side confirmation about the toggle), you'll switch back to state anyways.
You still have a point: don't overuse state - and make your state as dumb as possible. It'll save trouble in the long run.