Closed jimmykane closed 9 months ago
Hi! I am having the same issue here, any comments of fixes on this? Thank you!
@jimmykane @aledeloss There are two ways to fix it.
as
attribute:
declare module 'react' {
interface HTMLAttributes<T> extends AriaAttributes, DOMAttributes<T> {
as?: string | typeof MessageInput;
}
}
or
as
property:interface ExtentedInputProps extends MessageInputProps {
as?: string | typeof MessageInput;
}
const ExtendedInput = (props:ExtentedInputProps) => {
return (
<div>
<span>Custom content</span>
<MessageInput />
</div>
);
}
<ChatContainer>
<MessageList></MessageList>
<ExtendedInput as={MessageInput} />
</ChatContainer>
I have added this explanation to the documentation: https://chatscope.io/storybook/react/?path=/docs/documentation-recipes--page#what-about-typescript
Thank you !
On Fri, 19 May 2023, 10:29 am Super Snager, @.***> wrote:
I have added this explanation to the documentation:
https://chatscope.io/storybook/react/?path=/docs/documentation-recipes--page#what-about-typescript
— Reply to this email directly, view it on GitHub https://github.com/chatscope/chat-ui-kit-react/issues/99#issuecomment-1554162870, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAJVX4YPJTNIVSNS3SVRSOTXG4OMXANCNFSM6AAAAAAXK7AYOM . You are receiving this because you were mentioned.Message ID: @.***>
Example from recipeis
Typescript
Property 'as' does not exist on type 'DetailedHTMLProps<HTMLAttributes<HTMLDivElement>, HTMLDivElement>'