File tree Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Expand file tree Collapse file tree 1 file changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -67,18 +67,23 @@ export const WithoutCoreEditor = forwardRef<
67
67
emits . mounted ( shikitor )
68
68
} , [ ref ] )
69
69
70
- const { vRef : valueRef } = useDefault ( value , defaultValue , v => {
70
+ const vRefHandle = useCallback ( ( v : string ) => {
71
71
const shikitor = shikitorRef . current
72
72
if ( ! shikitor ) return
73
73
74
74
shikitor . value = v
75
- } )
76
- const { vRef : optionsRef } = useDefault ( options , defaultOptions , opts => {
75
+ } , [ ] )
76
+
77
+ const { vRef : valueRef } = useDefault ( value , defaultValue , vRefHandle )
78
+
79
+ const optionRefHandle = useCallback ( ( opts : Omit < ShikitorOptions , "plugins" > ) => {
77
80
const shikitor = shikitorRef . current
78
81
if ( ! shikitor ) return
79
82
80
83
shikitor . updateOptions ( old => ( { ...old , ...opts } ) )
81
- } )
84
+ } , [ ] )
85
+
86
+ const { vRef : optionsRef } = useDefault ( options , defaultOptions , optionRefHandle )
82
87
83
88
useEffect ( ( ) => {
84
89
if ( ! eleRef . current ) return
You can’t perform that action at this time.
0 commit comments