File tree 1 file changed +17
-1
lines changed
admin/src/components/ConfigDiff
1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 1
1
import React from 'react' ;
2
- import ReactDiffViewer , { DiffMethod } from 'react-diff-viewer-continued' ;
2
+ import RDV , { DiffMethod } from 'react-diff-viewer-continued' ;
3
3
import { useIntl } from 'react-intl' ;
4
4
5
+ /**
6
+ * An issue with the diff-viewer library causes a difference in the way the library is exported.
7
+ * Depending on whether the library is loaded through the browser or through the server, the default export may or may not be present.
8
+ * This causes issues with SSR and the way the library is imported.
9
+ *
10
+ * Below a workaround to fix this issue.
11
+ *
12
+ * @see https://github.com/Aeolun/react-diff-viewer-continued/issues/43
13
+ */
14
+ let ReactDiffViewer ;
15
+ if ( typeof RDV . default !== 'undefined' ) {
16
+ ReactDiffViewer = RDV . default ;
17
+ } else {
18
+ ReactDiffViewer = RDV ;
19
+ }
20
+
5
21
import {
6
22
Modal ,
7
23
Grid ,
You can’t perform that action at this time.
0 commit comments