1
0
mirror of https://github.com/ianstormtaylor/slate.git synced 2025-07-31 20:40:19 +02:00

fix ReactDOM batchedUpdates import

This commit is contained in:
Ian Storm Taylor
2019-12-05 12:02:41 -05:00
parent 7e6f680a1f
commit f461ae5d45

View File

@@ -1,4 +1,4 @@
import { unstable_batchedUpdates } from 'react-dom'
import ReactDOM from 'react-dom'
import { Editor, Node, Path, Operation, Command } from 'slate'
import { ReactEditor } from './react-editor'
@@ -93,7 +93,7 @@ export const withReact = (editor: Editor): Editor => {
// children and selection can get out of sync for one render pass. So we
// have to use this unstable API to ensure it batches them. (2019/12/03)
// https://github.com/facebook/react/issues/14259#issuecomment-439702367
unstable_batchedUpdates(() => {
ReactDOM.unstable_batchedUpdates(() => {
const contextOnChange = EDITOR_TO_ON_CHANGE.get(editor)
if (contextOnChange) {