Skip to content

Conversation

lcantraine
Copy link

No description provided.

@robodoo
Copy link

robodoo commented Sep 24, 2025

Pull request status dashboard

Copy link

@cgun-odoo cgun-odoo left a 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() });

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?'}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants