datchley / react-scale-text

A React library to keep an element's text scaled to fit it's container
MIT License
54 stars 18 forks source link

prop type `widthOnly` is invalid #15

Closed dbismut closed 6 years ago

dbismut commented 6 years ago

Hey - first of all congrats for the package, it's the only one from other automatic font sizing modules that Actually Works with my setup.

However, Chrome console prints the following when I'm rendering <ScaleText> in dev:

Warning: Failed prop type: ScaleText: prop type widthOnly is invalid; it must be a function, usually from the prop-types package, but received undefined.

No idea where that comes from, I've tried setting the widthOnly prop with no luck...

dbismut commented 6 years ago

Oh well, I guess it should be: widthOnly: PropTypes.bool (not and boolean)

https://github.com/datchley/react-scale-text/blob/58b335fe8103c476403dd1221a2589bfd7b03c35/src/index.js#L157

datchley commented 6 years ago

@dbismut Thanks for the PR! We had just noticed that before holiday break and I hadn't gotten around to putting the fix in yet.