-
Notifications
You must be signed in to change notification settings - Fork 2.6k
18.0 webframework lecan #979
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: 18.0
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
good job with the whole tutorial, just some things you can fix.
It's normal that you forget adding an empty line at the end of each file, you can use a formatter to automatically do it for you (I use prettier on vscode)
if you're wondering why we do that: https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline
|
||
addTodo(ev) { | ||
if (ev.keyCode === 13 && ev.target.value.trim().length > 0) { | ||
this.state.todos.push({ id: this.state.todos.length, description: ev.target.value.trim() }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using the length for id is a bit problematic.
Here is an example:
- I add the first todo {id: 0, description: 'do stuff'}
- I add the second todo {id: 1, description: 'don't do stuff'}
- I delete the first todo
- I add another todo {id: 1, description: 'why is the id the same with another todo?'}
No description provided.