Deschtex / html2react

A utility for turning raw HTML into React elements.
MIT License
43 stars 5 forks source link

Add support for setting global element overrides #6

Closed Deschtex closed 8 years ago

Deschtex commented 8 years ago

It would be nice to be able to set a list of default/global element overrides, so that one does not have to repeat the overrides for recurring conversions. Example:

import HTML2React from 'html2react'
import Link from './components/Link'

HTML2React.setGlobalElementOverrides({
  'a.external': (props) => (
    <Link external {...props} />
  )
})