Skip to content

Bug in redux docs basic example  #1040

Closed
@egoist-sx

Description

@egoist-sx

I have just finished reading redux document basics part. There is potentially a bug in basic secion.

If you add three todos, and switch to active filter, click first (which will disappear from list), and you are not able to 'complete' the first todo in those two left.

I think the problem is that in this example code, App only receive todos from 'current selected', and the 'map' function will generate index form this subset of state.todos(the singleton). However, 'COMPLETE_TODO' update index counting in that singleton todos. And there is no way those index matches (other than the case 'SHOW_ALL', as those two lists are equal).

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions