File tree Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Expand file tree Collapse file tree 1 file changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -28,17 +28,23 @@ class JsonDiffReact extends Component {
2828 tips,
2929 objectHash,
3030 } = this . props ;
31- const delta = Jsondiffpatch . create ( { objectHash } ) . diff ( left , right ) ;
31+ const delta = Jsondiffpatch . create ( {
32+ objectHash,
33+
34+ arrays : {
35+ // default true, detect items moved inside the array (otherwise they will be registered as remove+add)
36+ detectMove : true ,
37+ // default false, the value of items moved is not included in deltas
38+ includeValueOnMove : true ,
39+ } ,
40+ } ) . diff ( left , right ) ;
3241 const html = annotated
3342 ? formatters . annotated . format ( delta )
3443 : formatters . html . format ( delta , left ) ;
3544 show ? formatters . html . showUnchanged ( ) : formatters . html . hideUnchanged ( ) ;
3645 console . log ( "test" ) ;
3746 return html ? (
38- < span >
39- < h1 > hi there</ h1 >
40- < div dangerouslySetInnerHTML = { { __html : html } } />
41- </ span >
47+ < div dangerouslySetInnerHTML = { { __html : html } } />
4248 ) : (
4349 < p style = { { fontSize : 12 , color : "#999" } } >
4450 { tips || "Both objects are identical." }
You can’t perform that action at this time.
0 commit comments