During my time working on VILLASWeb I've encountered (and also created) code that may serve it's function but isn't what one would call 'best practice' or 'elegant' so I've created this issue to compile a few ideas where code could be refactored for better performance and readability. I'll work on this issue if there aren't any more pressing matters and will gladly accept input and more ideas. If something isn't feasible or wouldn't make sense please let me know :).
- 'Edit' edit-widget. Especially the handleChange function is overblown and could loose some complexity
- Shrink states of components. Find parameters that could be fused and/or reused.
- Work with shouldComponentUpdate to weed out unnecessary re-renders.
- Replace all function binding in render with arrow functions in class property.
- Renovate large components like dashboard. Find functions with similar use and try to fuse them into a more generalized function (for example open/close module functions)
- Add 'prop-types' to more components
scenario.jsas this file becomes too big to handle efficiently
- Check all calculateState functions for parts that should be in the constrcutor rather than calculateState and reduce calcualteState to a minimum!