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

type "[key: string]: any" makes extension difficult #592

Open
jamesarosen opened this issue Jun 27, 2024 · 0 comments
Open

type "[key: string]: any" makes extension difficult #592

jamesarosen opened this issue Jun 27, 2024 · 0 comments

Comments

@jamesarosen
Copy link

The library declares

declare const Markdown: React.FC<{
    [key: string]: any;
    children: string;
    options?: MarkdownToJSX.Options;
}>;

This makes it hard to wrap the Markdown component because every type becomes an any. For example:

import MarkdownToJsx from 'markdown-to-jsx';

type MyMarkdownProps =
  HTMLProps<HTMLDivElement> &
  Pick<ComponentPropsWithoutRef<typeof MarkdownToJsx>, 'children' | 'options'>

type Children = MyMarkdownProps['children'] // any, not string
type Children = MyMarkdownProps['options'] // any, not Partial<...>
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