We’ll add a handler to the form so we can take new input and use it to update the application state. We’ll append new items to the list with the AddTodo function and replace the todos list in state. We’ll also clear out our form so it can accept new todos.
Anyone else not getting the id generated in the new todo?
nevermind, wasn't returning the newId in the generateID function
Why generate a random ID number instead of incrementing a number? Chances of getting the same ID number based on that line of code shown in the video is quite small, but incrementing will ensure no duplicate ID number exists at all.
Why generate a random ID number instead of incrementing a number? Chances of getting the same ID number based on that line of code shown in the video is quite small, but incrementing will ensure no duplicate ID number exists at all.
I noticed that too. There's alternatives for ensuring a unique ID that I would use instead: https://en.wikipedia.org/wiki/Universally_unique_identifier