I followed your tutorial and have 2 question.
- Why have you opted to use ref for clearing the component value but still used onChange handler? I think you should either use a ref to get and reset the value or make a fully controlled input by passing value and onChange handler. Then you can use setFormState(“”) to clear.
- What does the exclamation point before “text” do in this case? Never seen it before.
newTodosState.find((todo: TodoInterface) => todo.id === id)!.text = event.target.value;
Overall nice article, helped me to do something tangible in Typescript 👍