Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix incorrect types for <GiftedChat /> component #2576

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

danilvalov
Copy link
Contributor

Please check this PR carefully. I'm not 100% sure about it because I don't fully understand the original typing logic that was there before (I think the old logic was wrong from the start).

My research started with trying to understand why the renderFooter prop in the <GiftedChat /> component gives me a typescript error if I try to use an argument from the renderFooter function. I found it weird that we extend the GiftedChatProps interface from the MessageContainer class and not from the MessageContainerProps interface. This is a problem why Typescript told me that this function had no arguments, although the function itself returned props (this function refers to the MessageContainer class, not the MessageContainerProps interface).

And in the end I noticed this pull request. There are several users discussing this issue.

I think my PR will fix all the major typing issues. But I don't understand why no one noticed this elephant in the code before me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant