Rinakat225 / Todo-list

0 stars 0 forks source link

Clean code pt.2: keep it DRY #30

Closed kresimir-coko closed 1 month ago

kresimir-coko commented 2 months ago

In NewTaskForm.jsx we have a situation where we are resetting state twice using the same 4 lines. In one example those 4 lines are separated by an empty line, in the other they are not.

image

TLDR: Extract the 4 lines into a resetState function.