DEV Community

loading...

Discussion on: 3 React Mistakes Junior Developers Make With Component State

Collapse
miohtama profile image
Mikko Ohtamaa • Edited

Good post! I hope TypeScript flavoured react would provide decorators or generics to prevent misuing the state in the first place. E.g. setting the properties read-only and make forcing the use of prevState more obvious. In this way Angular is a little bit better, as it has more structure around this that makes harder to make human mistakes.