Rinakat225 / Todo-list

0 stars 0 forks source link

Don't use named functions but instead use arrow functions stored into variables #8

Closed kresimir-coko closed 2 months ago

kresimir-coko commented 2 months ago

https://github.com/Rinakat225/Todo-list/blob/9425613facb42840182d01162eea3856be179630/src/App.js#L18

This would instead be

const handleAddNewTask = (task) => {
   ...
}

Also, function naming is important, it should represent what is being handled, not explaining the code inside. So maybe something like handleAddNewTaskButtonClick, or handleNewTaskButtonClick, or handleAddButtonClick, but the event and the target usually has to be in the name of the event handler

Rinakat225 commented 2 months ago

Done on commit: https://github.com/Rinakat225/Todo-list/commit/99122534db55785a0222a6872af300ec65b77221