Skip to content

react/no-array-index-key - Breaking this.props.children in to chunks and using index as a key #1123

Closed
@penx

Description

Are there circumstances when it is ok to use array index as a key? If so, could these exceptions be added to the documentation here:

https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md

I have run in to an issue where I am breaking down this.props.children in to several chunks in order to render them in a grid - but I can't see how I could use anything other than the array index as an identifier - more information here:

http://stackoverflow.com/questions/42983067/breaking-children-in-to-chunks-and-react-no-array-index-key

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