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

Missing keys on iterators #73

Open
apennell opened this issue Jul 23, 2018 · 10 comments · May be fixed by #179
Open

Missing keys on iterators #73

apennell opened this issue Jul 23, 2018 · 10 comments · May be fixed by #179

Comments

@apennell
Copy link

Version: ^0.4.2

Steps to Reproduce

View a PDF with multiple pages
Look at JS console in browser

Expected Behavior

Keys on all iterators so that there are no warnings

Actual Behavior

Warning in console:

warning.js?6327:33 Warning: Each child in an array or iterator should have a unique "key" prop. Check the render method of `t`. See https://fb.me/react-warning-keys for more information.
    in t (created by t)
    in t (created by t)
    in div (created by t)
    in div (created by t)
    in t (created by EvidencePreviewModal)

I tracked this line 117 in pdf-viewer.jsx, although it may be happening in other file type components as well. A key needs to be added here within <PDFPage />: key={`page-${index}`}. I don't have time at the moment to do it, but if you're open to PR's I may be able to get to it.

@aarontropy
Copy link

Can confirm. That would fix it.

@cmwint
Copy link
Contributor

cmwint commented Aug 29, 2019

@apennell @aaronnorby I am also experiencing this issue. I went ahead and created a PR to fix this: #107

@apennell
Copy link
Author

apennell commented Sep 5, 2019

Awesome @cmwint! Switched jobs and forgot about this issue 😁

@SalmanHaider5
Copy link

Still issue is there, if anyone there to maintain it please do it first, its a really good package.

@bsell93
Copy link

bsell93 commented Apr 20, 2020

Looks like the change never got deployed to npm

@bsell93
Copy link

bsell93 commented Apr 20, 2020

Just kidding it looks like the change got removed in this commit
78f1581#diff-227f34f5a8fb440046daea8d13f0c149

Current code in master:

(<PDFPage
index={i + 1}
pdf={pdf}
containerWidth={containerWidth}
zoom={zoom * INCREASE_PERCENTAGE}
disableVisibilityCheck={this.props.disableVisibilityCheck}
/>)

@bsell93
Copy link

bsell93 commented Apr 20, 2020

@michaelwolo can we get this change undone?

@mattburlage
Copy link

bumping this. Any chance this can happen?

@bsell93 bsell93 linked a pull request Feb 22, 2021 that will close this issue
@bsell93
Copy link

bsell93 commented Feb 22, 2021

Made a pr to fix #179

@HasinaNjaratin
Copy link

The issue still exists. till 2019. is this lib maintained?

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 a pull request may close this issue.

7 participants