File tree Expand file tree Collapse file tree 1 file changed +17
-1
lines changed
admin/src/components/ConfigDiff Expand file tree Collapse file tree 1 file changed +17
-1
lines changed Original file line number Diff line number Diff line change 11import React from 'react' ;
2- import ReactDiffViewer , { DiffMethod } from 'react-diff-viewer-continued' ;
2+ import RDV , { DiffMethod } from 'react-diff-viewer-continued' ;
33import { useIntl } from 'react-intl' ;
44
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+
521import {
622 Modal ,
723 Grid ,
You can’t perform that action at this time.
0 commit comments