Skip to content

Commit d605c0f

Browse files
committed
window key updated
1 parent 1c6e831 commit d605c0f

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

src/components/MailUiEditor.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import useEditorOptions from "../hooks/useEditorOptions";
1010
import useEditorInitialization from "../hooks/useEditorInitialization";
1111
import useEventHandlers from "../hooks/useEventHandlers";
1212

13-
window.__mailui_newEditorId = window.__mailui_newEditorId || 0;
13+
// window.__mailui_newEditorId = window.__mailui_newEditorId || 0;
1414

1515
const MailUiEditor = React.forwardRef<MailUiEditorRef, MailUiEditorProps>(
1616
(props, ref) => {

src/hooks/useEditorId.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
import {MailUiEditorProps} from "../MailUiEditor";
22
import {useMemo} from "react";
33

4+
const clientWindow = typeof window === 'undefined' ? { __mailui_newEditorId: 0 } : window
5+
clientWindow.__mailui_newEditorId = clientWindow.__mailui_newEditorId || 0;
6+
47
const useEditorId = (props: MailUiEditorProps) => {
58
return useMemo(() => {
69
return props.editorId || `editor-${++window.__mailui_newEditorId}`

0 commit comments

Comments
 (0)