import React from "react"; import { Overlay } from "react-bootstrap"; import "../../scss/components/buttons/ButtonWithOverlay.scss"; interface IPropsButtonWithOverlay { name: string; innerOverlay: JSX.Element; text: string | JSX.Element; className?: string; } interface IStateButtonWithOverlay { show: boolean; } class ButtonWithOverlay extends React.Component { props: IPropsButtonWithOverlay = { innerOverlay: , name: "", text: "" }; state: IStateButtonWithOverlay; static defaultProps: Partial = { className: "" }; constructor(props: IPropsButtonWithOverlay) { super(props); this.state = { show: false }; } render(): JSX.Element { return ( this.setState({ show: !this.state.show }) } > {this.props.text} this.setState({ show: false }) } > {this.props.innerOverlay} ); } } export default ButtonWithOverlay;