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

children typescript erorr #181

Closed
ovezovv opened this issue Sep 1, 2022 · 3 comments
Closed

children typescript erorr #181

ovezovv opened this issue Sep 1, 2022 · 3 comments

Comments

@ovezovv
Copy link

ovezovv commented Sep 1, 2022

Adding this:

  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

@miallo
Copy link
Collaborator

miallo commented Sep 9, 2022

Unfortunately this project is no longer maintained. The last alpha release you mentioned is two years old and there was no further commit in this repo...

@pwfcurry
Copy link

pwfcurry commented Nov 28, 2022

See my answer here oblador/react-native-collapsible#450 (comment) for a temporary workaround.

See also #158

@a8c71
Copy link

a8c71 commented Dec 16, 2022

thank you @pwfcurry , below is the file I added and its now working

// md-children-fix.d.ts

import React from 'react';

declare module 'react-native-markdown-display' {
  // https://www.typescriptlang.org/docs/handbook/declaration-merging.html#merging-interfaces
  interface MarkdownProps {
    children?: React.ReactNode;
  }
}

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

5 participants