Open
Description
In 4.0.5, if DiffViewer has a custom renderContent, the component sometimes silently renders a blank line.
Turns out, word compareMethod is not compatible with renderContent, if renderContent returns anything but a string. Ironically, the type of it allows to return only non-strings:
react-diff-viewer-continued/src/index.tsx
Lines 53 to 54 in 8bc70d3
Reproduce:
<DiffViewer
compareMethod={DiffMethod.WORDS}
newValue="Foo Bar"
oldValue="Foo"
renderContent={str => <div>{str}</div>}
/>
The cause seems to be this silent return statement, introduced in c0c99f5:
react-diff-viewer-continued/src/index.tsx
Line 197 in 8bc70d3
Metadata
Metadata
Assignees
Labels
No labels