Skip to content

Commit 5f6051e

Browse files
authored
Merge pull request #49 from metalabdesign/remove-fbjs
Remove deprecated props warning and fbjs dependency
2 parents 85a62d8 + 20fcbc7 commit 5f6051e

File tree

3 files changed

+3
-37
lines changed

3 files changed

+3
-37
lines changed

packages/flowtip-react-dom/package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@
2929
"prepare": "npm run clean && npm run copy && npm run build"
3030
},
3131
"dependencies": {
32-
"fbjs": "^0.8.12",
3332
"flowtip-core": "^5.0.0",
3433
"react-resize-observer": "^0.2.0"
3534
},

packages/flowtip-react-dom/src/FlowTip.js

Lines changed: 3 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
import * as React from 'react';
33
import {findDOMNode} from 'react-dom';
44
import ResizeObserver from 'react-resize-observer';
5-
import invariant from 'fbjs/lib/invariant';
65

76
import flowtip, {
87
RIGHT,
@@ -15,22 +14,8 @@ import flowtip, {
1514

1615
import type {RectLike, Region, Align, Dimensions, Result} from 'flowtip-core';
1716

18-
import singleWarning from './util/singleWarning';
1917
import getContainingBlock from './util/getContainingBlock';
2018

21-
const REMOVED_PROPS = [
22-
'anchor',
23-
'width',
24-
'height',
25-
'offset',
26-
'clamp',
27-
'rotationOffset',
28-
'targetAlign',
29-
'targetAlignOffset',
30-
'rootAlign',
31-
'rootAlignOffset',
32-
'hideInDisabledRegions',
33-
];
3419
// Static `flowtip` layout calculation result mock for use during initial client
3520
// side render or on server render where DOM feedback is not possible.
3621
const STATIC_RESULT: Result = {
@@ -166,15 +151,6 @@ class FlowTip extends React.Component<Props, State> {
166151
// ===========================================================================
167152
// Lifecycle Methods.
168153
// ===========================================================================
169-
componentWillMount(): void {
170-
REMOVED_PROPS.forEach((prop) => singleWarning(
171-
`${prop}_deprecated`,
172-
!this.props.hasOwnProperty(prop),
173-
'React FlowTip `%s` prop is has been removed in this version.',
174-
prop,
175-
));
176-
}
177-
178154
componentDidMount(): void {
179155
this._isMounted = true;
180156

@@ -463,7 +439,9 @@ class FlowTip extends React.Component<Props, State> {
463439
} else {
464440
// Refine nullable `document.body`.
465441
// see: https://stackoverflow.com/questions/42377663
466-
invariant(document.body !== null, 'document.body is null');
442+
if (document.body === null) {
443+
throw new Error('document.body is null');
444+
}
467445
this._containingBlockNode = document.body;
468446
}
469447
}

packages/flowtip-react-dom/src/util/singleWarning.js

Lines changed: 0 additions & 11 deletions
This file was deleted.

0 commit comments

Comments
 (0)