lhz516 / react-h5-audio-player

React audio player component with UI. It provides time indicator on both desktop and mobile devices.
https://codepen.io/lhz516/pen/dyGpmgP
MIT License
587 stars 91 forks source link

Fixes the mounting issue introduced by React 18's new strict mode #179

Closed ferdiamg closed 1 year ago

ferdiamg commented 1 year ago

Should fix this issue: https://github.com/lhz516/react-h5-audio-player/issues/169#issuecomment-1255343175

lhz516 commented 1 year ago

As I mentioned in https://github.com/lhz516/react-h5-audio-player/issues/169 - if we only remove this line, the audio would continue playing even if the component is destroyed. So we need some alternative solution.

never mind, I just tested it and found that the audio won't stop when the component is destroyed.