Closed bitboxer closed 8 months ago
I'm getting the same issue
Same here also as well as @bitboxer defined above adding:
children?: ReactNode;
to the node_modules/react-native-markdown-display/src/index.d.ts
fixed type error, working variant is below:
export interface MarkdownProps {
rules?: RenderRules;
children?: ReactNode;
style?: StyleSheet.NamedStyles<any>;
renderer?: AstRenderer;
markdownit?: MarkdownIt;
mergeStyle?: boolean;
debugPrintTree?: boolean;
onLinkPress?: (url: string) => boolean;
}
Please, consider this I am using version 7.0.0-alpha.2
any chances if this issue can be fixed?
@alihussnain-git you can use patch-package to fix it temporary for yourself.
@alihussnain-git you can use patch-package to fix it temporary for yourself.
Or simply use ts-ignore 😁
I've extended the types
Somewhere in you code add a Markdown.d.ts
insert
import { ComponentType, ReactNode } from 'react';
import { MarkdownProps } from 'react-native-markdown-display';
declare module 'react-native-markdown-display' {
export const ExtendedMarkdown: ComponentType<
{
children: ReactNode;
} & MarkdownProps
>;
export = ExtendedMarkdown;
}
make sure the type file is in the folders mentioned in "typeRoots": ["./node_modules/@types", "./src/types"]
in your tsconfig.json
I've extended the types Somewhere in you code add a
Markdown.d.ts
insert
import { ComponentType, ReactNode } from 'react'; import { MarkdownProps } from 'react-native-markdown-display'; declare module 'react-native-markdown-display' { export const ExtendedMarkdown: ComponentType< { children: ReactNode; } & MarkdownProps >; export = ExtendedMarkdown; }
make sure the type file is in the folders mentioned in
"typeRoots": ["./node_modules/@types", "./src/types"]
in your tsconfig.json
This worked for me :D
I am getting this error when using typescript:
Adding
To the
Fixes it for me.