Skip to content

Added custom `elements` prop to RichText component

Compare
Choose a tag to compare
@hypervillain hypervillain released this 08 Jan 13:51
· 162 commits to master since this release

In order to use custom React elements without heavily relying on htmlSerializer, a new elements prop has been created:

It takes an object of React components, accessible by "Elements" type (one of heading1, em, strong...)

Example use:

<RichText elements={{ heading1: MyStyledComponent }} render={data.text} />