Html2React: Cover the remaining edge cases

Description

The current implementation is missing some of the edge cases when converting from HTML to react. Examples:

  • We need to add key attributes if an element has siblings
  • Handle the aria-* and SVG props correctly
  • Preserve custom attributes correctly (to handle webcomponents)

Examples

https://github.com/remarkablemark/html-react-parser

Possible solution

A possible solution is to re-use the attributesToProps function from:

Additionally, there is some potential for code reuse from: https://github.com/remarkablemark/html-react-parser/blob/master/lib/dom-to-react.js