TypeError: currentPropName.toLowerCase is not a function
in sort-prop-types
#2212
Labels
TypeError: currentPropName.toLowerCase is not a function
in sort-prop-types
#2212
The rule
sort-prop-types
(withignoreCase: true
) will produce this error when usingPropTypes.shape
with a number as a key.Here's an example to reproduce this issue
The error occurs at this line https://github.com/yannickcr/eslint-plugin-react/blob/v7.12.4/lib/rules/sort-prop-types.js#L192.
Using a string instead of the number as the key when defining the propTypes avoid this issue
I'm not sure if using a number instead of a string as a key is "idiomatic" React; I didn't see an example of this in the React documentation either way.
The text was updated successfully, but these errors were encountered: