import React, { MouseEvent } from 'react'; import { CSSTransition } from 'react-transition-group'; import './style.less'; interface Props { visible: boolean; hideMask?: (v: boolean) => void; } interface State {} class Box extends React.Component { constructor(props: Props) { super(props); this.handleHide = this.handleHide.bind(this); this.handleContentClick = this.handleContentClick.bind(this); this.onEnter = this.onEnter.bind(this); this.onExit = this.onExit.bind(this); } render() { const { visible, children } = this.props; return (
this.handleContentClick(e)}> {children}
); } handleHide() { this.props.hideMask(true); } handleContentClick(e: MouseEvent) { e.stopPropagation(); console.log('handleContentClick'); } onEnter(node: HTMLElement, isAppearing: boolean) { console.log('onEnter', isAppearing); } onExit(node: HTMLElement) { console.log('onExit'); } } export default Box;