-
-
Notifications
You must be signed in to change notification settings - Fork 3k
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
Unique "key" prop warning when using SubComponent #56
Comments
What version are you using? I just patched a unique key prop bug today.
…On Fri, Feb 3, 2017 at 3:15 PM TacticalCoding ***@***.***> wrote:
If I add a table with a SubComponent it gives me a "key" warning:
Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of `src`. See https://fb.me/react-warning-keys for more information.
This happens even including a very simple SubComponent:
SubComponent={(x) => (<div>hi</div>)}
I believe it is because the Expander Cell fields do not have a "key"
attribute even though they are within the allVisibleColumns map.
Expander Cell Code
<https://github.com/tannerlinsley/react-table/blob/aa48ef57ee26b88dfa03d85f0364c06556b53356/src/index.js#L671>
The pivot columns might have the same issue but I haven't tested it.
Overall I'm really happy with this library.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#56>, or mute the
thread
<https://github.com/notifications/unsubscribe-auth/AFUmCXBECRB6aMVgVJJguIJiTi02kXF8ks5rY6ccgaJpZM4L23nH>
.
|
5.0.1 |
Good catch. Could you pr a fix that adds those keys? |
Yes but I might not get to it until Monday.
On Feb 3, 2017 at 4:10 PM, <Tanner Linsley ***@***.***)> wrote:
Good catch. Could you pr a fix that adds those keys?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub (#56 (comment)), or mute the thread (https://github.com/notifications/unsubscribe-auth/AFU_DGDrxeo9h2dnqyCbnlFQ0Y2DPMulks5rY8H7gaJpZM4L23nH).
]]>
|
Hey Tanner I just updated to 5.0.2 and I'm getting this for my subcomponents. line 780 doesn't seem to have |
I don't think 5.0.2 has the commits that fix those warnings. I think your commit (1e4f838) is the one that fixed it for SubComponents but that was merged after the commit marked 5.0.2. The commit after yours (e11fdab) fixes the warning for Pivot Tables. I don't think like 780 needs a key field because it is not the top level component of an array or iterator. |
If I add a table with a SubComponent it gives me a "key" warning:
This happens even including a very simple SubComponent:
I believe it is because the Expander Cell fields do not have a "key" attribute even though they are within the allVisibleColumns map.
Expander Cell Code
The pivot columns might have the same issue but I haven't tested it.
Overall I'm really happy with this library.
The text was updated successfully, but these errors were encountered: