import React, { Component, Fragment } from 'react'; import './tooltip.css'; import { HelpIcon } from './icons'; class Tooltip extends Component { constructor(props) { super(props); this.state = { active: false }; this.handleClick = this.handleClick.bind(this); } handleClick(event) { event.preventDefault(); this.setState({ active: !this.state.active }); } render() { console.log(this.state, this.props) return (
{ this.state.active? (
{this.props.text}
) : null }
); } } export default Tooltip;