Skip to content

Commit

Permalink
log warning when trying to use both props
Browse files Browse the repository at this point in the history
  • Loading branch information
hannojg committed Mar 7, 2023
1 parent b294069 commit 9863204
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/components/Tooltip/TooltipRenderedOnPageBody.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import {Animated, View} from 'react-native';
import ReactDOM from 'react-dom';
import getTooltipStyles from '../../styles/getTooltipStyles';
import Text from '../Text';
import Log from '../../libs/Log';

const propTypes = {
/** Window width */
Expand Down Expand Up @@ -72,6 +73,10 @@ class TooltipRenderedOnPageBody extends React.PureComponent {
tooltipHeight: 0,
};

if (props.renderTooltipContent && props.text) {
Log.warn('Developer error: Cannot use both text and renderTooltipContent props at the same time in <TooltipRenderedOnPageBody />!');
}

this.measureTooltip = this.measureTooltip.bind(this);
this.updateTooltipContentWidth = this.updateTooltipContentWidth.bind(this);
}
Expand Down

0 comments on commit 9863204

Please sign in to comment.