1
1
import React from 'react' ;
2
- import MultiRootEditor from '@ckeditor/ckeditor5-build-multi-root' ;
3
2
4
- import { useMultiRootEditor , type MultiRootHookProps , CKEditorContext } from '@ckeditor/ckeditor5-react' ;
3
+ import { useMultiRootEditor , type MultiRootHookProps , CKEditorContext } from '../../src' ;
4
+ import MultiRootEditor from './MultiRootEditor' ;
5
5
6
6
export default function ContextMultiRootEditorDemo ( ) : JSX . Element {
7
7
return (
8
8
< >
9
9
{ /* @ts -expect-error: Caused by linking to parent project and conflicting react types */ }
10
- < CKEditorContext context = { MultiRootEditor . Context } >
10
+ < CKEditorContext
11
+ context = { MultiRootEditor . Context as any }
12
+ contextWatchdog = { MultiRootEditor . ContextWatchdog as any }
13
+ >
11
14
< ContextEditorDemo />
12
15
</ CKEditorContext >
13
16
</ >
@@ -16,6 +19,7 @@ export default function ContextMultiRootEditorDemo(): JSX.Element {
16
19
17
20
function ContextEditorDemo ( ) : JSX . Element {
18
21
const editorProps : Partial < MultiRootHookProps > = {
22
+ // @ts -expect-error: Caused by linking to parent project and conflicting react types
19
23
editor : MultiRootEditor ,
20
24
21
25
onChange : ( event , editor ) => {
@@ -40,6 +44,7 @@ function ContextEditorDemo(): JSX.Element {
40
44
} ,
41
45
42
46
onReady : editor => {
47
+ // @ts -expect-error: Caused by linking to parent project and conflicting react types
43
48
window . editor1 = editor ;
44
49
45
50
console . log ( 'event: onChange' , { editor } ) ;
@@ -56,6 +61,7 @@ function ContextEditorDemo(): JSX.Element {
56
61
} ,
57
62
58
63
onReady : editor => {
64
+ // @ts -expect-error: Caused by linking to parent project and conflicting react types
59
65
window . editor2 = editor ;
60
66
61
67
console . log ( 'event: onChange' , { editor } ) ;
@@ -88,6 +94,7 @@ function ContextEditorDemo(): JSX.Element {
88
94
< div >
89
95
< div className = "buttons" >
90
96
< button
97
+ // @ts -expect-error: Caused by linking to parent project and conflicting react types
91
98
onClick = { ( ) => simulateError ( editor1 ! ) }
92
99
disabled = { ! editor1 }
93
100
>
@@ -107,6 +114,7 @@ function ContextEditorDemo(): JSX.Element {
107
114
< div >
108
115
< div className = "buttons" >
109
116
< button
117
+ // @ts -expect-error: Caused by linking to parent project and conflicting react types
110
118
onClick = { ( ) => simulateError ( editor2 ! ) }
111
119
disabled = { ! editor2 }
112
120
>
0 commit comments