vuvu
vuvu

Reputation: 5308

The onMouseLeave function is not called correctly

The MouseLeave-function is called when I enter the svg-path with the mouse but not when leave it. The MouseEnter-funtion is called correctly. What is wrong?

 return (
          <path
          onMouseEnter={_this.onMouseEnter.bind(this, d)}
          onMouseLeave={_this.onMouseLeave()}/>
   )

Upvotes: 0

Views: 229

Answers (1)

Tholle
Tholle

Reputation: 112777

You should not call _this.onMouseLeave. Just do the same you did for _this.onMouseEnter:

return (
  <path
    onMouseEnter={_this.onMouseEnter.bind(this, d)}
    onMouseLeave={_this.onMouseLeave.bind(this, d)}/>
)

Upvotes: 1

Related Questions