Commit 121a6fd
committed
fix(todos): use addDismissedTodo thunk to prevent stale closure on dismiss
dismissTodo was closing over dismissedTodos from the last render. When
the parent component did not re-render after the first dismiss, the
second dismiss called setDismissedTodos with only the new id, overwriting
the previously dismissed one and causing it to reappear stuck with the
is-dismissing class.1 parent 5fb96c4 commit 121a6fd
1 file changed
Lines changed: 2 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
41 | | - | |
| 41 | + | |
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | | - | |
| 50 | + | |
56 | 51 | | |
57 | 52 | | |
58 | 53 | | |
| |||
0 commit comments