DEV Community

Discussion on: Module not found: Can't resolve 'uuid/v4'

 
mtt87 profile image
Mattia Asti

Try to make a reproducible example on Codesandbox, might be easier for people to help you

Also read dev.to/p/editor_guide

If you want to put the code you do it like this



```
code
```


Thread Thread
 
lolleri200 profile image
lolleri200

I have the whole code in my Github :)
github.com/lolleri200/Todo/blob/ma...

Thread Thread
 
mtt87 profile image
Mattia Asti

it's

localStorage.setItem()

not

localStorage.SetItem()

developer.mozilla.org/en-US/docs/W...

Thread Thread
 
lolleri200 profile image
lolleri200

Ohh thanks! Works perfectly now :)

Thread Thread
 
lolleri200 profile image
lolleri200

But there seems to be a bug that happens when I add a todo it adds 2 of the same items and when I try to remove it it gives me an error:
TypeError: toggleTodo is not a function
handleTodoClick

  2 | 
  3 | export default function Todo({ todo, toggleTodo }) {
  4 |     function handleTodoClick() {
> 5 |       toggleTodo(todo.id)
  6 |     }
  7 |     
  8 |     return (
 130 |   toggleTodo
  131 | }) {
  132 |   function handleTodoClick() {
> 133 |     toggleTodo(todo.id);
      |     ^  134 |   }
  135 | 
  136 |   return /*#__PURE__*/react__WEBPACK_IMPORTED_MODULE_0___default.a.createElement("div", {