Slide 33
Slide 33 text
Extending the rendering
Editor decorator strategy
const numberedHeadingsStrategy = (contentBlock, callback, contentState) => {
const type = contentBlock.getType();
const isHeading = ["header-one", "header-two", "header-three", "header-four", "header-five"].includes(type);
if (isHeading) {
callback(0, contentBlock.getText().length);
}
}
Vesa Vänskä 2017 @vesan