我在這里有這個類組件
class App extends React.Component {
getHowler() {
this.player.howler;
}
getDuration() {
this.player.duration();
}
getSeek() {
this.player.seek();
}
setSeek() {
this.player.seek(0.5);
}
// This sound file may not work due to cross-origin setting
render() {
return (
<ReactHowler
src="http://goldfirestudios.com/proj/howlerjs/sound.ogg"
playing={true}
ref={(ref) => (this.player = ref)}
/>
);
}
}
我希望將其轉換為功能組件。我想在功能組件中使用反應咆哮
轉載請註明出處,本文鏈接:https://www.uj5u.com/qukuanlian/344941.html
上一篇:隨時顯示陣列內容,陣列中的某個專案在我的React專案中無法正常作業
下一篇:陣列元素反應未定義
