You could pass a getState
callback when you create the plugin, something like this:
let state = EditorState.create({
...
plugins: [myPlugin({getState: () => state}), ...]
})
function myPlugin({getState}) {
return new Plugin(...)
}
You could pass a getState
callback when you create the plugin, something like this:
let state = EditorState.create({
...
plugins: [myPlugin({getState: () => state}), ...]
})
function myPlugin({getState}) {
return new Plugin(...)
}