You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note that toPlatePlugin called from createPlatePlugin makes a copy of the plugin.
Since overrideEditor is an arrow function, the plugin is actually retrieved from the outer scope, which is the slate plugin that not yet returned from createSlatePlugin, not the one copied and created by createPlatePlugin. Therefore, the plugin returned after overrideEditor call will not contain withComponent
Description
Root cause:
withComponent is defined here:
plate/packages/core/src/react/plugin/toPlatePlugin.ts
Lines 93 to 98 in 309533a
overrideEditor is defined here:
plate/packages/core/src/lib/plugin/createSlatePlugin.ts
Lines 240 to 253 in 309533a
createPlatePlugin is defined here:
plate/packages/core/src/react/plugin/createPlatePlugin.ts
Lines 37 to 50 in 309533a
Note that
toPlatePlugin
called fromcreatePlatePlugin
makes a copy of the plugin.Since overrideEditor is an arrow function, the
plugin
is actually retrieved from the outer scope, which is the slate plugin that not yet returned fromcreateSlatePlugin
, not the one copied and created bycreatePlatePlugin
. Therefore, the plugin returned afteroverrideEditor
call will not containwithComponent
Reproduction URL
No response
Reproduction steps
Plate version
42
Slate React version
not related
Screenshots
No response
Logs
No response
Browsers
No response
The text was updated successfully, but these errors were encountered: