gajus/youtube-player

Event handlers cannot be overwritten - With react

Open

#62 创建于 2017年6月15日

在 GitHub 查看
 (3 评论) (4 反应) (1 负责人)JavaScript (80 fork)github user discovery
enhancementhelp wantedquestion

仓库指标

Star
 (386 star)
PR 合并指标
 (PR 指标待抓取)

描述

Hi,

I'm using your youtube-player with react and I pleased of how it work but I have a problem when I want to destroy and recreate a player.

If you don't know how react work there is the event componentDidMount and componentWillUnmount that are called when the component is created and destroyed.

At componentWillUnmount I create the player and bind one event. When componentWillUnmount is launch (changing page for example) I unbind the player event. But when I create again the player (componentWillUnmount ) I got this error :

Event handlers cannot be overwritten

Is there something else I should do when I when to delete the player ?

贡献者指南