How to use the html-to-react/lib/utils.createElement function in html-to-react

To help you get started, we’ve selected a few html-to-react examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github TerriaJS / terriajs / lib / ReactViews / Custom / parseCustomHtmlToReact.js View on Github external
processNode: function(node, children, index) {
      // eslint-disable-line react/display-name
      const elementProps = {
        key: "anchor-" + keyIndex++,
        target: "_blank",
        rel: "noreferrer noopener"
      };
      node.attribs = combine(node.attribs, elementProps);
      return utils.createElement(node, index, node.data, children);
    }
  });

html-to-react

A lightweight library that converts raw HTML to a React DOM structure.

MIT
Latest version published 1 year ago

Package Health Score

70 / 100
Full package analysis