arttuka / reagent-material-ui

Reagent wrapper for MUI (formerly Material UI) v5
Eclipse Public License 2.0
203 stars 18 forks source link

Icons with multiple paths cause `unique "key" prop` error #27

Closed jhacksworth closed 2 years ago

jhacksworth commented 2 years ago

Icons that have more than one path element cause the following error message:

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

I modified the example project to reproduce the error here: https://github.com/jhacksworth/reagent-material-ui/commit/f5a1ef9e1d42784c77574b423b00709101fbd7f6

and run it with shadow-cljs by:

  1. Changing to the example directory
  2. npm install
  3. npm run watch

Screenshot:

Screen Shot 2021-10-18 at 5 14 54 PM

The zoom-in icon has two path elements (two calls to the e macro) and causes the error message:

https://github.com/arttuka/reagent-material-ui/blob/8754c2e2923bb6379add666313e297543bdc9df5/src/icons/reagent_mui/icons/zoom_in.cljs#L8

The face icon, which only has one path element, does not cause an error message:

https://github.com/arttuka/reagent-material-ui/blob/8754c2e2923bb6379add666313e297543bdc9df5/src/icons/reagent_mui/icons/face.cljs#L8

It looks like 2044 out of 8875 icons have multiple paths in src/icons/reagent_mui/icons/

Thanks for creating this library, it's been a pleasure to use!

arttuka commented 2 years ago

Fixed in 5.2.4-0.

jhacksworth commented 2 years ago

Just tried it out and it works great. Cheers! 🍻