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

Removed unnecessary invariant usage #1181

Merged
merged 1 commit into from
Apr 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions src/component/base/DraftEditor.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,6 @@ class DraftEditor extends React.Component {
const scrollParent = Style.getScrollParent(editorNode);
const {x, y} = scrollPosition || getScrollPosition(scrollParent);

invariant(editorNode, 'Missing editorNode');
invariant(
editorNode instanceof HTMLElement,
'editorNode is not an HTMLElement',
Expand Down Expand Up @@ -382,7 +381,6 @@ class DraftEditor extends React.Component {

_blur(): void {
const editorNode = ReactDOM.findDOMNode(this.refs.editor);
invariant(editorNode, 'Missing editorNode');
invariant(
editorNode instanceof HTMLElement,
'editorNode is not an HTMLElement',
Expand Down
1 change: 0 additions & 1 deletion src/component/contents/DraftEditorBlock.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,6 @@ class DraftEditorBlock extends React.Component {
);
}
} else {
invariant(blockNode, 'Missing blockNode');
invariant(
blockNode instanceof HTMLElement,
'blockNode is not an HTMLElement',
Expand Down
1 change: 0 additions & 1 deletion src/component/contents/DraftEditorTextNode.react.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,6 @@ class DraftEditorTextNode extends React.Component {
shouldComponentUpdate(nextProps: Props): boolean {
const node = ReactDOM.findDOMNode(this);
const shouldBeNewline = nextProps.children === '';
invariant(node, 'Missing node');
invariant(node instanceof Element, 'node is not an Element');
if (shouldBeNewline) {
return !isNewline(node);
Expand Down