Open
Conversation
|
Bump |
|
found the same error and fixed it in the same way |
danielkv
approved these changes
Dec 14, 2022
|
Can we merge this please? Thanks! |
|
Another possible better fix is to just change the type MarkdownStatic = React.ComponentType<React.PropsWithChildren<MarkdownProps>>;You can use patch-package to update this type with the following patch:
diff --git a/node_modules/react-native-markdown-display/src/index.d.ts b/node_modules/react-native-markdown-display/src/index.d.ts
index eb9ff5b..4add358 100644
--- a/node_modules/react-native-markdown-display/src/index.d.ts
+++ b/node_modules/react-native-markdown-display/src/index.d.ts
@@ -93,7 +93,9 @@ export interface MarkdownProps {
onLinkPress?: (url: string) => boolean;
}
-type MarkdownStatic = React.ComponentType<MarkdownProps>;
+// Patch applied for allowing children of the MarkdownStatic component.
+// Remove patch when this PR is merged: https://github.com/iamacup/react-native-markdown-display/pull/178
+type MarkdownStatic = React.ComponentType<React.PropsWithChildren<MarkdownProps>>;
export const Markdown: MarkdownStatic;
export type Markdown = MarkdownStatic;
export {MarkdownIt};
|
pistonsky
reviewed
Apr 21, 2023
| mergeStyle?: boolean; | ||
| debugPrintTree?: boolean; | ||
| onLinkPress?: (url: string) => boolean; | ||
| children: string |
There was a problem hiding this comment.
Better to wrap this interface with PropsWithChildren from react.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To fix the typescript error