react-native-htmlview icon indicating copy to clipboard operation
react-native-htmlview copied to clipboard

Custom function to renderNode

Open Aung-Myint-Thein opened this issue 5 years ago • 0 comments

Is there a way to inject custom function renderNode? My use case is that I am rendering an iframe node in renderNode but I would like to add a custom function so that I can record onPress.

function renderNode(node, index, siblings, parent, defaultRenderer) {
  if (node.name === 'iframe') {
    const a = node.attribs;
    
    return (
      <Video 
        src={a.src}
        // revealVideo={???} <<---- I would like to pass a function to my own Video component
      />
    );
  }
}

const articleContent = props => {
  return ( 
    <HTMLView
      value={ props.content }
      stylesheet={styles}
      renderNode={renderNode}
    /> 
  );
}   

Thanks.

Aung-Myint-Thein avatar Jun 10 '19 03:06 Aung-Myint-Thein