@@ -15,7 +15,6 @@ import flowtip, {
1515
1616import type { RectLike , Region , Align , Dimensions , Result } from 'flowtip-core' ;
1717
18- import omit from './util/omit' ;
1918import singleWarning from './util/singleWarning' ;
2019import getContainingBlock from './util/getContainingBlock' ;
2120
@@ -32,28 +31,6 @@ const REMOVED_PROPS = [
3231 'rootAlignOffset' ,
3332 'hideInDisabledRegions' ,
3433] ;
35-
36- const FLOWTIP_PROPS = [
37- 'target' ,
38- 'bounds' ,
39- 'region' ,
40- 'sticky' ,
41- 'targetOffset' ,
42- 'edgeOffset' ,
43- 'tailOffset' ,
44- 'align' ,
45- 'topDisabled' ,
46- 'rightDisabled' ,
47- 'bottomDisabled' ,
48- 'leftDisabled' ,
49- 'constrainTop' ,
50- 'constrainRight' ,
51- 'constrainBottom' ,
52- 'constrainLeft' ,
53- 'content' ,
54- 'tail' ,
55- ] ;
56-
5734// Static `flowtip` layout calculation result mock for use during initial client
5835// side render or on server render where DOM feedback is not possible.
5936const STATIC_RESULT : Result = {
@@ -126,6 +103,32 @@ export type Props = {
126103 children ?: React . Node ,
127104} ;
128105
106+ const omitFlowtipProps = ( props : Props ) => {
107+ const {
108+ target : _target ,
109+ bounds : _bounds ,
110+ region : _region ,
111+ sticky : _sticky ,
112+ targetOffset : _targetOffset ,
113+ edgeOffset : _edgeOffset ,
114+ tailOffset : _tailOffset ,
115+ align : _align ,
116+ topDisabled : _topDisabled ,
117+ rightDisabled : _rightDisabled ,
118+ bottomDisabled : _bottomDisabled ,
119+ leftDisabled : _leftDisabled ,
120+ constrainTop : _constrainTop ,
121+ constrainRight : _constrainRight ,
122+ constrainBottom : _constrainBottom ,
123+ constrainLeft : _constrainLeft ,
124+ content : _content ,
125+ tail : _tail ,
126+ ...rest
127+ } = props ;
128+
129+ return rest ;
130+ } ;
131+
129132class FlowTip extends React . Component < Props , State > {
130133 static defaultProps = {
131134 bounds : null ,
@@ -615,7 +618,7 @@ class FlowTip extends React.Component<Props, State> {
615618 const { children , content : Content } = this . props ;
616619
617620 const contentProps = {
618- ...omit ( FLOWTIP_PROPS , this . props ) ,
621+ ...omitFlowtipProps ( this . props ) ,
619622 style : this . _getContentStyle ( result ) ,
620623 } ;
621624
0 commit comments