Closed chiaberry closed 7 years ago
Another question: when do I have to event.preventDefault()
?
Always? Never?
Only when the event has a default action that you are trying to prevent. I.e. Calling preventdefault on an input will keep a letter from appearing but will still register the keydown event which has access to the key which was pressed.
Similarly with a form, if the form event is not prevented the page will attempt to navigate to the form action location.
Most events do not need to be prevented
Button added to set to today.
Currently I don’t initialize anything in state besides the page, so you are saying to fix this warning, I need to set a default value?