gpt4 book ai didi

Wavesurfer.js fails when using map function: Uncaught (in promise) TypeError: Failed to fetch(使用MAP函数时Wavesurfer.js失败:未捕获(承诺中)TypeError:无法获取)

转载 作者:bug小助手 更新时间:2023-10-25 20:02:15 25 4
gpt4 key购买 nike



Audio waveform generation and playback component using Wavesurfer.js renders the first item in an array fine, but fails when rendering subsequent items.

使用Wavesurfer.js的音频波形生成和回放组件可以很好地呈现数组中的第一个项目,但在呈现后续项目时会失败。


this error


Code

代码


Wavesurfer.js docs show that the container element for a single waveform component should be included as a property in the return statement. However, the container element is not being updated with each pass of the map loop.

Js文档显示,单个波形组件的容器元素应该作为属性包含在返回语句中。但是,容器元素不会随着映射循环的每一次传递而更新。


Are renders failing because we're triggering the first render successfully (using useEffect) and subsequent ones are unable to "find" the correct container element?

呈现失败是因为我们成功地触发了第一次呈现(使用useEffect),并且后续呈现无法“找到”正确的容器元素吗?


Here's the Wavesurfer example code for a single waveform using React. I'm unable to find examples of apps using multiple Wavesurfer waveforms, which would be super useful.

以下是使用REACT的单个波形的Wavesurfer示例代码。我找不到使用多个Wavesurfer波形的应用程序示例,这将是非常有用的。


更多回答
优秀答案推荐
更多回答

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com