[Bug] Typing errors conflict with documentation
IngoVals opened this issue · 4 comments
Using the Messenger component in Typescript results in annoying typing errors. The props field is defined with
providerKey: Provider | undefined;
but would be better served as providerKey?: Provider
so we are not forced to do <Messenger providerKey={undefined} />
or <Messenger providerKey='messenger' />
This also does not match with the documentation which doesn't indicate any props are necessary. The same is true with the mention of locale
property which does not exist.
Using version 2.7.3
Using the Messenger component in Typescript results in annoying typing errors.
I understand your frustration with implementation issues or gaps in documentation, but please remember that saying something is annoying isn't helpful and does not provide useful insight to the issue diagnosis.
The props field is defined with
providerKey: Provider | undefined;
but would be better served asproviderKey?: Provider
so we are not forced to do<Messenger providerKey={undefined} />
or<Messenger providerKey='messenger' />
This also does not match with the documentation which doesn't indicate any props are necessary.
Do you think you'd be in a position to write a PR implementing your suggestions?
The same is true with the mention of locale property which does not exist.
I haven't reviewed the library in a while, but from a brief look the locale property is mapped in the messenger provider. Can you describe how locale
does not exist in a little more detail?
Absolutely should be more technical, but annoying wasn't to represent my frustration but rather to indicate it was not a showstopper but merely an inconvenience.
Regarding locale, the doc indicates that this prop is on the provider, but is seems to be on the Messenger component itself.
I'm all for helping with a PR, but seems like updating the readme would go a long way and I would def need a review from someone understanding the library better.
Regarding locale, the doc indicates that this prop is on the provider, but is seems to be on the Messenger component itself.
Great, thanks for the clarification. I agree, looks like a README
update will fix that.
I'm all for helping with a PR, but seems like updating the readme would go a long way and I would def need a review from someone understanding the library better.
No problem, happy to assist you in getting the PR completed.
Thanks for raising these issues @IngoVals, happy to report that our Typescript definitions have been improved in the latest release (2.8.0) and README has been updated to match ✅