react-native-markdown-display icon indicating copy to clipboard operation
react-native-markdown-display copied to clipboard

Failing to render a <View> or <Pressable>

Open vccoffey opened this issue 7 months ago • 0 comments

I'm using a plugin to add a custom rule to add a shortcode <my-button title='something' ... /> and render a custom component in its place.

This works when I render a simple <Text> tag like this

  const myButtonRule: RenderRules['my_button'] = (
    node,
    _children,
    _parent,
    _styles
  ) => {
    const { href, variant, title } = node.attributes
    return <Text>TEST: {title}</Text> // This works
    return <View><Text>TEST</Text></View> // This does not work. Just renders a blank white space
  }
  
  const rules = { my_button: myButtonRule }

However, when I render a <View> or <Pressable>, I just get a white space where the component should be.

I need to render a <Pressable> or <View> to render the proper styles.

vccoffey avatar Jul 19 '24 00:07 vccoffey