-
Couldn't load subscription status.
- Fork 232
Open
Description
I have a case where I need to conditionally skip the custom render when using a custom block renderer map. The code already supports the ability to skip if null is returned but this is blocked by type linting. Can we make changes to the TypeScript and Flow definitions to allow BlockRenderer to be string or null. This is my sample code:
blockRenderers: {
unstyled: (block: Draft.ContentBlock): string | null => {
if (block.getText().trim() === '') {
return '';
}
return null;
}
}
I can open a PR to do this but wanted to see if there were any arguments against this first.
The change would be to
| type BlockRenderer = (block: draftjs.ContentBlock) => string; |
| type BlockRenderer = (block: ContentBlock) => ?string; |
Metadata
Metadata
Assignees
Labels
No labels