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(Table): fix react key error on sibling cells with same string content #4198

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

jhns88
Copy link

@jhns88 jhns88 commented May 2, 2021

Fixes #4034, also include a test and documentation for tableData attribute usage in Table component.

Please have a look especially at line 68 of src/collections/Table/TableRow.js.

The newly created react key of "string containing" cells will have the following format (screenshot taken from docs):

react_key_prop

In my opinion, this should be a good way to create "unique" keys for the cells because the cell index is also used for key creation.

But I don't know if creating the React Key attribute this way may have mentionable performance impact in huge lists. At least it should have a little but in sake of errorless rendering.

@welcome
Copy link

welcome bot commented May 2, 2021

💖 Thanks for opening this pull request! 💖

Here is a list of things that will help get it across the finish line:

  • Run yarn lint locally to catch formatting errors. This will fix some errors automatically, commit and push any changes.
  • Run yarn test locally to catch errors. This ensures all components still behave as they should.
  • Run yarn start to run the doc site locally and try a few pages, ensuring everything is in good working order.
  • Include tests when adding/changing behavior.

We get a lot of pull requests on this repo, so please be patient and we will get back to you as soon as we can.

@codecov-commenter
Copy link

codecov-commenter commented May 2, 2021

Codecov Report

Merging #4198 (a7dddc2) into master (bb2db59) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4198   +/-   ##
=======================================
  Coverage   99.75%   99.75%           
=======================================
  Files         180      180           
  Lines        3241     3244    +3     
=======================================
+ Hits         3233     3236    +3     
  Misses          8        8           
Impacted Files Coverage Δ
src/collections/Table/TableRow.js 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update ff70355...a7dddc2. Read the comment docs.

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.

Table shorthand produces key warning if table cell content repeats
2 participants