AlpacaTravel / react-map-gl-alt

React Mapbox-GL-JS binding with improved performance, event and API exposure
Other
42 stars 2 forks source link

PropTypes.oneOf possibly causing error in browser console #23

Closed buzzswarbrick closed 5 years ago

buzzswarbrick commented 5 years ago

I'm trying to trace an error in the console in which I get this:

Warning: Invalid arguments supplied to oneOf, expected an array, got 2 arguments. A common mistake is to write oneOf(x, y, z) instead of oneOf([x, y, z]).

And looking through our codebase I cannot find any reference to PropTypes.oneOf, however I did come across this under src/map.jsx which might be causing this error.

customAttribution: PropTypes.oneOf(PropTypes.string, PropTypes.array),

which might need to be refactored to

customAttribution: PropTypes.oneOf([PropTypes.string, PropTypes.array]),

cammanderson commented 5 years ago

Great thanks for that. Easy fix and was published a couple of days ago. Appreciate the issue report.