Closed jefflewis closed 8 months ago
Sorry, but how can I use this fix?
@dendenmuniz If you don't want to wait for a release, you can do this:
import React, { ComponentType, PropsWithChildren } from 'react';
import _Markdown, { MarkdownProps } from 'react-native-markdown-display';
type MarkdownWithChildrenT = ComponentType<PropsWithChildren<MarkdownProps>>;
const Markdown = _Markdown as MarkdownWithChildrenT;
export const SomeComponent: React.FunctionComponent = () => {
const md = '';
return (
<Markdown>{md}</Markdown>
);
};
@dendenmuniz You should go directly to node modules where you have the library installed, then change the necessary code, in this case are only two lines:
import {ComponentType, PropsWithChildren , ReactNode} from 'react';
type MarkdownStatic = ComponentType<PropsWithChildren<MarkdownProps>>;
After you did the necessary changes play with the code and check if everything is working as you expected.
If everything is working well you should create the patch, to do that I recommend you read the documentation, it's just execute a command npx patch-package <package_name>
but before that you need to install patch-package library and configure some scripts on your package.json
and that should be all.
I hope help with this comment.
I created a pull request for this issue @iamacup
Hi! ๐
Firstly, thanks for your work on this project! ๐
Today I used patch-package to patch
react-native-markdown-display@7.0.0-alpha.2
for the project I'm working on.The types for this project do not currently have
Children
.Here is the diff that solved my problem:
This issue body was partially generated by patch-package.