iamacup / react-native-markdown-display

React Native 100% compatible CommonMark renderer

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

children typescript erorr

ovezovv opened this issue · comments

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

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...

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

See also #158

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