When there is a function with the same name, there is a problem with the difference algorithm. As shown in the following figures: 1. in react-diff-viewer-continued  2. in other diff website  Hope this issue can be fixed. Thank you !