You can use decorators to modify the rendering behaviour of your content.
The decorator find your custom patterns and will decorate them with the component that you want.
You can use
createDecorator utility to create your custom decorators.
Each decorator can have three parts:
The decorator strategy help you to find the patterns that needs to be replaced.
You can define easily your strategies with the help of
After finding the matches of your pattern in the editor state, they'll be replaced by the provided component.
You can optionally pass some default props to your component. The props value should be an object.
As an example, you can define a decorator that find all link entities and replace those entities with the link component.
An example of
createDecorator to add images to the editor: