1
0
mirror of https://github.com/trezor/trezor-wallet synced 2024-11-24 01:08:27 +00:00

Fixed tooltip ref

This commit is contained in:
Vladimir Volek 2018-09-05 12:45:19 +02:00
parent 1ff9060ff0
commit cb0288a687

View File

@ -172,17 +172,12 @@ const Wrapper = styled.div`
`;
class Tooltip extends Component {
constructor(props) {
super(props);
this.tooltipContainerRef = React.createRef();
}
render() {
const { placement, content, children } = this.props;
return (
<Wrapper innerRef={this.tooltipContainerRef}>
<Wrapper innerRef={(node) => { this.tooltipContainerRef = node; }}>
<RcTooltip
getTooltipContainer={() => this.tooltipContainerRef.current}
getTooltipContainer={() => this.tooltipContainerRef}
arrowContent={<div className="rc-tooltip-arrow-inner" />}
placement={placement}
overlay={<TooltipContent>{content}</TooltipContent>}