react-selectrix
react-selectrix copied to clipboard
Prop type warning when passing a non String value as a key
Issue description
I've came across a proptype warning when passing an int as options key. focusItem is declared as a string in App.js seems reasonable enough so i think a simple conversion is enough as a think many people may try to pass an int as the option key, my case was passing the product_id from a an api.
I know that this is against the PropTypes use but i think an exception here adds some kind of flexibility
Steps to reproduce the issue
Just pass an int as the options key, you can try it in the PlayGround.js file
What's the expected result?
I think a conversion, maybe wrong
What's the actual result?
A proptype warning
Additional details / screenshot

A fix maybe https://github.com/bampisSyk/react-selectrix/commit/9a987e60bf4db1a58c048f00e78bb4f8152f33bc
Very nice remark!
Is "focusedItem" the only prop related to options, that excepts a string? Or we should consider normalize all the options before we pass it down to the component?
A pull request will be really helpful! Thanks a lot
About to do some more digging... i'll post back the results
Any feedback on this?