iamacup / react-native-markdown-display

React Native 100% compatible CommonMark renderer
MIT License
564 stars 166 forks source link

children typescript erorr #181

Closed ovezovv closed 8 months ago

ovezovv commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

See my answer here https://github.com/oblador/react-native-collapsible/issues/450#issuecomment-1328800327 for a temporary workaround.

See also https://github.com/iamacup/react-native-markdown-display/issues/158

a8c71 commented 1 year ago

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;
  }
}