22import * as React from 'react' ;
33import { findDOMNode } from 'react-dom' ;
44import ResizeObserver from 'react-resize-observer' ;
5- import invariant from 'fbjs/lib/invariant' ;
65
76import flowtip , {
87 RIGHT ,
@@ -15,22 +14,8 @@ import flowtip, {
1514
1615import type { RectLike , Region , Align , Dimensions , Result } from 'flowtip-core' ;
1716
18- import singleWarning from './util/singleWarning' ;
1917import 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.
3621const 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 }
0 commit comments