Add null return types to BlockRenderer and defaultBlockTag
#201
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR adds two
nulltypes to the TypeScript definition ofdraft-js-export-html:BlockRendereranddefaultBlockTag.These
nullreturn types are present in the documentation (and code), but were missing from the TypeScript definition, thus causing type linting/compilation errors.I decided to combine both changes in a single PR, as the changes are small and simple enough and touch the same file.
Changes
BlockRendererThe docs state:
The possibility to return
nullorundefinedwas missing from the TypeScript definition, meaning it wasn't possible to defer to the default renderer in aBlockRendererfunction.defaultBlockTagThe docs state:
The TypeScript definition didn't allow for this, as it required a
stringto be returned.Related issues
BlockRenderer: BlockRenderer type can be null #132defaultBlockTag: defaultBlockTag type can accept null #197