当我使用鼠标输入svg-path时调用MouseLeave函数,但在离开时不调用。正确调用MouseEnter-funtion。有什么问题?
return (
<path
onMouseEnter={_this.onMouseEnter.bind(this, d)}
onMouseLeave={_this.onMouseLeave()}/>
)
答案 0 :(得分:1)
你不应该致电_this.onMouseLeave
。就像你为_this.onMouseEnter
所做的一样:
return (
<path
onMouseEnter={_this.onMouseEnter.bind(this, d)}
onMouseLeave={_this.onMouseLeave.bind(this, d)}/>
)