Hi,
How can I define custom block types like native DraftJS block types?
I tried using custom blockStyleFn and it looks like this:
const getBlockStyle = (block) => {
switch(block.getType()) {
case 'alignRight':
return 'editor-align-right';
case 'blockquote':
return 'editor-blockquote';
default:
return null;
};
};
However, I am getting nullthrows error, when alignRight blockType is passed to this function, but blockquote native DraftJS blockType works just fine.
I searched the repo and I thought that this PR should have fixed the issue, since it was merged into current 0.7.0 version.
Any help or advice on how to accomplish what I am looking for would be greatly appreciated! Thanks!
Is anyone paying attention to the problems of users on this repo at all?
Really? It's been 12 hours.
Check out the docs here about setting blockRenderMap: https://github.com/facebook/draft-js/pull/387/files.
Most helpful comment
Really? It's been 12 hours.