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
null
types to the TypeScript definition ofdraft-js-export-html
:BlockRenderer
anddefaultBlockTag
.These
null
return 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
BlockRenderer
The docs state:
The possibility to return
null
orundefined
was missing from the TypeScript definition, meaning it wasn't possible to defer to the default renderer in aBlockRenderer
function.defaultBlockTag
The docs state:
The TypeScript definition didn't allow for this, as it required a
string
to be returned.Related issues
BlockRenderer
: BlockRenderer type can be null #132defaultBlockTag
: defaultBlockTag type can accept null #197