wavesurfer-react icon indicating copy to clipboard operation
wavesurfer-react copied to clipboard

Fix infinite rerendering bug when plugins array is provided

Open dohyun-ko opened this issue 1 year ago • 0 comments

      <WavesurferPlayer
        height={100}
        waveColor={waveColor}
        url={audioUrls[urlIndex]}
        onReady={(ws) => setWavesurfer(ws)}
        onPlay={() => setIsPlaying(true)}
        onPause={() => setIsPlaying(false)}
        plugins={[]}
      />

When plugins array is provided like above (whether empty or not), useEffect in useWavesurferInstance causes infinite rerendering.

Fixed this bug by serializing the options instead of flattening them.

dohyun-ko avatar Sep 15 '24 14:09 dohyun-ko