Skip to content
This repository has been archived by the owner on Feb 6, 2023. It is now read-only.

Commit

Permalink
ReactDOMComet
Browse files Browse the repository at this point in the history
Reviewed By: catchingash

Differential Revision: D19522615

fbshipit-source-id: 6829a906faa2cc5fd8feb4e5e7b85c1450287260
  • Loading branch information
sebmarkbage authored and facebook-github-bot committed Feb 10, 2020
1 parent a9fcbb2 commit 24339f1
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 6 deletions.
7 changes: 1 addition & 6 deletions src/component/base/DraftEditor.react.js
Expand Up @@ -23,11 +23,11 @@ const DraftEditorCompositionHandler = require('DraftEditorCompositionHandler');
const DraftEditorContents = require('DraftEditorContents.react');
const DraftEditorDragHandler = require('DraftEditorDragHandler');
const DraftEditorEditHandler = require('DraftEditorEditHandler');
const flushControlled = require('DraftEditorFlushControlled');
const DraftEditorPlaceholder = require('DraftEditorPlaceholder.react');
const DraftEffects = require('DraftEffects');
const EditorState = require('EditorState');
const React = require('React');
const ReactDOM = require('ReactDOM');
const Scroll = require('Scroll');
const Style = require('Style');
const UserAgent = require('UserAgent');
Expand Down Expand Up @@ -263,11 +263,6 @@ class DraftEditor extends React.Component<DraftEditorProps, State> {
* editor mode, if any has been specified.
*/
_buildHandler(eventName: string): Function {
const flushControlled: (fn: Function) => void =
/* $FlowFixMe(>=0.79.1 site=www) This comment suppresses an error found
* when Flow v0.79 was deployed. To see the error delete this comment and
* run Flow. */
ReactDOM.unstable_flushControlled;
// Wrap event handlers in `flushControlled`. In sync mode, this is
// effectively a no-op. In async mode, this ensures all updates scheduled
// inside the handler are flushed before React yields to the browser.
Expand Down
18 changes: 18 additions & 0 deletions src/component/base/DraftEditorFlushControlled.js
@@ -0,0 +1,18 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow strict-local
* @emails oncall+draft_js
*/

const ReactDOM = require('ReactDOM');

const flushControlled: void | ((fn: () => void) => void) =
// $FlowExpectedError unstable_flushControlled is not yet in the upstream Flow typing
ReactDOM.unstable_flushControlled;

module.exports = flushControlled;

0 comments on commit 24339f1

Please sign in to comment.