iamacup / react-native-markdown-display

React Native 100% compatible CommonMark renderer
MIT License
590 stars 169 forks source link

Cannot add a child that doesn't have a YogaNode to a parent without a measure function! #129

Closed Arxcis closed 10 months ago

Arxcis commented 3 years ago

package.json

    "react": "^16.9.0",
    "react-native": "0.62.2",
    "react-native-markdown-display": "^7.0.0-alpha.2",

Problem When using react-native-markdown-display, I get the following error:

Cannot add a child that doesn't have a YogaNode to a parent without a measure function! (Trying to add a RCTVirtualText to RCTView

The error is triggered inside a <Markdown>-wrapper component I made, which accepts "strings" as props:

import React from "react";
import ReactNativeMarkdown from "react-native-markdown-display";

export function Markdown(props: {
  text?: string;
  children?: string;
  style?: any;
}) {
  const children = props.text ?? props.children ?? "";

  return (
    <ReactNativeMarkdown style={props.style}>{children}</ReactNativeMarkdown>
  );
}

Any help to understand my problem is much appreciated :pray: I have no idea what this error message requires me to do..