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

ThreeDotsIcon throws unique key prop warning #5731

Open
3 of 5 tasks
alexnagelberg opened this issue Apr 17, 2023 · 3 comments · May be fixed by #5742
Open
3 of 5 tasks

ThreeDotsIcon throws unique key prop warning #5731

alexnagelberg opened this issue Apr 17, 2023 · 3 comments · May be fixed by #5742

Comments

@alexnagelberg
Copy link

Description

When using ThreeDotsIcon (used in IconButton specifically) it throws a react warning about not having key props

CodeSandbox/Snack link

https://snack.expo.dev/t3JUBCRz-

Steps to reproduce

(haven't tested CRA but it should complain -- it loves to complain about those. did test with metro.)

  1. Init react-native app (npx react-native init ...)
  2. Add element in app
  3. Run with metro
  4. See complaint either in devtools warning popup or in metro console

NativeBase Version

3.4.28

Platform

  • Android
  • CRA
  • Expo
  • iOS
  • Next

Other Platform

No response

Additional Information

"Warning: Each child in a list should have a unique "key" prop."

Looks like it's a bug because the path passed is an array of items to render vs the other icons which is just a single element

@r0nz-29
Copy link

r0nz-29 commented Apr 29, 2023

Unable to reproduce this issue, attaching a screenshot of the expo snack (link).
The app runs without any errors.

Screenshot_20230430_001248

Perhaps this has already been solved?

@alexnagelberg
Copy link
Author

Unable to reproduce this issue, attaching a screenshot of the expo snack (link). The app runs without any errors.

Screenshot_20230430_001248

Perhaps this has already been solved?

Try with steps I provided — it works in expo snack but it could be using a different render method or quieter warnings. CRA and react-native init do NOT like rendering lists without keys. Unless they’re doing some magic where they inject their own unique keys for rendering arrays, it looks to me like expo isn’t bothering to warn on this. ThreeDotsIcon so far as I can tell is the only with an array even though I think it just has one item.

@r0nz-29
Copy link

r0nz-29 commented May 1, 2023

Thanks for the clarification @alexnagelberg !
I've fixed this warning locally and am working on a PR for the same

@r0nz-29 r0nz-29 linked a pull request May 2, 2023 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants