Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(CarouselIndicators): li key values generate from provided item va… #1311

Merged
merged 2 commits into from
Dec 1, 2018
Merged

fix(CarouselIndicators): li key values generate from provided item va… #1311

merged 2 commits into from
Dec 1, 2018

Conversation

walker-tx
Copy link
Contributor

…lues

Generation of key items for li components in CarouselIndicators is a
concatenation of specific, optional values (src, caption, and
altText) in each item of the items object array. Lacking these
key/value pairs will cause each li element to have a key along the
lines of undefinedundefinedundefined, resulting two or more of the
li's to be identical and causing an error to log in the console.
While either including any one of the specified keys with a unique
value, or adding a unique key field in each of the items objects will
remedy this issue, that solution is not well documented. The proposed
solution is a transparent fix: preventing the aforementioned error while
requiring no change of code for the end-user. The new key prop value
for each li will be a concatenation of all the values of its
respective item object.

Closes #1310

  • Bug fix
  • New feature
  • Chore
  • Breaking change
  • There is an open issue which this change addresses
  • I have read the CONTRIBUTING document.
  • My commits follow the Git Commit Guidelines
  • My code follows the code style of this project.
  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

…lues

Generation of key items for `li` components in `CarouselIndicators` is a
concatenation of specific, optional values (`src`, `caption`, and
`altText`) in each item of the `items` object array. Lacking these
key/value pairs will cause each `li` element to have a key along the
lines of `undefinedundefinedundefined`, resulting two or more of the
`li`'s to be identical and causing an error to log in the console.
While either including any one of the specified keys with a unique
value, or adding a unique `key` field in each of the items objects will
remedy this issue, that solution is not well documented. The proposed
solution is a transparent fix: preventing the aforementioned error while
requiring no change of code for the end-user. The new `key` prop value
for each `li` will be a concatenation of all the values of its
respective item object.

Closes #1310
@TheSharpieOne TheSharpieOne merged commit fd7506d into reactstrap:master Dec 1, 2018
@walker-tx walker-tx deleted the indicator-key-values branch December 1, 2018 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CarouselIndicators] Warning: Encountered two children with the same key
2 participants