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

GiftedChatProps does not use GiftedChat TMessage generic type parameter #2464

Open
tedgoodley opened this issue Nov 30, 2023 · 0 comments
Open

Comments

@tedgoodley
Copy link

Issue Description

GiftedChatProps does not use GiftedChat TMessage generic type parameter. Without this, types that extend IMessage will have type mismatch errors when used as props; e.g. Type 'MyMessage | undefined' is not assignable to type 'Message | undefined'.

Steps to Reproduce / Code Snippets

This line: https://github.com/FaridSafi/react-native-gifted-chat/blob/ba06287912151dbfb71951893d0454db8aafd5a5/src/GiftedChat.tsx#L55C38-L55C38

This seems to be a bug since GiftedChatProps has its own TMessage type parameter which is passed to other prop types.

Expected Results

GiftedChatProps should use TMessage as a type param:
declare function GiftedChat<TMessage extends IMessage = IMessage>(props: GiftedChatProps<TMessage>): JSX.Element;

Additional Information

  • react-native-gifted-chat version: 2.4.0
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

No branches or pull requests

1 participant