Skip to content

Commit 217a290

Browse files
authored
Merge pull request #4801 from kopeczech/patch-1
Replacing map with filter in an example
2 parents 9a3692d + 905ca07 commit 217a290

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/usage/deriving-data-selectors.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ function TodoList() {
146146
// highlight-start
147147
// ❌ WARNING: this _always_ returns a new reference, so it will _always_ re-render!
148148
const completedTodos = useSelector(state =>
149-
state.todos.map(todo => todo.completed)
149+
state.todos.filter(todo => todo.completed)
150150
)
151151
// highlight-end
152152
}

0 commit comments

Comments
 (0)