From 897f7272219977ddee80fb068428fdb153540e9f Mon Sep 17 00:00:00 2001 From: Caleb Meredith Date: Thu, 17 Aug 2017 01:04:30 -0700 Subject: [PATCH] Flow v0.53.0 Codemod #9 Summary: bypass-lint ignore-conflict-markers ignore-signed-source ignore-nocommit Reviewed By: avikchaudhuri fbshipit-source-id: 66be84ebf50021cffa01f525f8cfb55ea3caf175 --- src/component/base/DraftEditor.react.js | 7 ++----- src/component/handlers/edit/editOnBlur.js | 2 +- src/component/utils/isSoftNewlineEvent.js | 2 +- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/src/component/base/DraftEditor.react.js b/src/component/base/DraftEditor.react.js index 7b6085ba09..599e4b3fbb 100644 --- a/src/component/base/DraftEditor.react.js +++ b/src/component/base/DraftEditor.react.js @@ -66,10 +66,7 @@ type State = { * div, and provides a wide variety of useful function props for managing the * state of the editor. See `DraftEditorProps` for details. */ -class DraftEditor extends React.Component { - props: DraftEditorProps; - state: State; - +class DraftEditor extends React.Component { static defaultProps: DraftEditorDefaultProps = { blockRenderMap: DefaultDraftBlockRenderMap, blockRendererFn: emptyFunction.thatReturnsNull, @@ -213,7 +210,7 @@ class DraftEditor extends React.Component { return null; } - render(): React.Element { + render(): React.Node { const {readOnly, textAlignment} = this.props; const rootClass = cx({ 'DraftEditor/root': true, diff --git a/src/component/handlers/edit/editOnBlur.js b/src/component/handlers/edit/editOnBlur.js index 616a41ddc4..5429e9976d 100644 --- a/src/component/handlers/edit/editOnBlur.js +++ b/src/component/handlers/edit/editOnBlur.js @@ -19,7 +19,7 @@ const EditorState = require('EditorState'); const containsNode = require('containsNode'); const getActiveElement = require('getActiveElement'); -function editOnBlur(editor: DraftEditor, e: SyntheticEvent): void { +function editOnBlur(editor: DraftEditor, e: SyntheticEvent<>): void { // In a contentEditable element, when you select a range and then click // another active element, this does trigger a `blur` event but will not // remove the DOM selection from the contenteditable. diff --git a/src/component/utils/isSoftNewlineEvent.js b/src/component/utils/isSoftNewlineEvent.js index 1ef6692da1..837217e46e 100644 --- a/src/component/utils/isSoftNewlineEvent.js +++ b/src/component/utils/isSoftNewlineEvent.js @@ -15,7 +15,7 @@ var Keys = require('Keys'); -function isSoftNewlineEvent(e: SyntheticKeyboardEvent): boolean { +function isSoftNewlineEvent(e: SyntheticKeyboardEvent<>): boolean { return e.which === Keys.RETURN && ( e.getModifierState('Shift') || e.getModifierState('Alt') ||