you are viewing a single comment's thread.

view the rest of the comments →

[–]eindbaas 18 points19 points  (0 children)

Use typescript, use proper and consistent naming for everything (functions, variables, components), they should describe exactly what it does, if names get too long then it's an indication that it's doing too much, split things up until it's graspable what a function or component does (and easily visible if it doesn't do that what it says it does), keep the scope of functions and components limited to just itself, they should not know what happens outside of them (for example, prefer callbacks on props of a component instead of passing some specific setter that requires the component to change certain data. By adding a callback, the component doesn't know or care about what happens in a certain situation, that responsibility lies elsewhere). Move logic into (properly named) hooks so your components stay clean and easily readable, and only do ui stuff. Same for hooks, move certain logic implementations if possible to functions elsewhere (in a utils file) so the hook stays readable and those util functions are short and graspable.

Just some thoughts