Skip to content

Commit c77d5a3

Browse files
committed
docs: update example components
1 parent 18f5818 commit c77d5a3

7 files changed

Lines changed: 18 additions & 18 deletions

File tree

docs/src/components/Example/OscilloscopeDefault.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ export const OscilloscopeDefault = () => {
1313
}, [])
1414

1515
React.useEffect(() => {
16-
if (!audioBuffer || !analyser) return
17-
initPlayer(audioBuffer, [analyser])
18-
}, [audioBuffer, analyser])
16+
if (!audioBuffer || !analyser.current) return
17+
initPlayer(audioBuffer, [analyser.current])
18+
}, [audioBuffer, analyser.current])
1919

2020
const handleTrigger = () => {
2121
if (isPlaying) {

docs/src/components/Example/SliderUncontrolled.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ export const SliderUncontrolled = () => {
2424
}, [])
2525

2626
useEffect(() => {
27-
if (!audioBuffer || !meter) return
28-
initPlayer(audioBuffer, [meter])
29-
}, [audioBuffer, meter])
27+
if (!audioBuffer || !meter.current) return
28+
initPlayer(audioBuffer, [meter.current])
29+
}, [audioBuffer, meter.current])
3030

3131
const handlePlay = () => {
3232
if (!player) return

docs/src/components/Example/SpectrogramDefault.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ export const SpectrogramDefault = () => {
2929
}, [])
3030

3131
React.useEffect(() => {
32-
if (!analyser) return
33-
initPlayer(audioBuffer!, [analyser])
34-
}, [audioBuffer, analyser])
32+
if (!analyser.current) return
33+
initPlayer(audioBuffer!, [analyser.current])
34+
}, [audioBuffer, analyser.current])
3535

3636
const handleTrigger = async () => {
3737
if (isPlaying) stop()

docs/src/components/Example/VuMeterColor.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ export const VuMeterColor = () => {
2424
}, [])
2525

2626
React.useEffect(() => {
27-
if (!audioBuffer || !meter) return
28-
initPlayer(audioBuffer, [meter])
27+
if (!audioBuffer || !meter.current) return
28+
initPlayer(audioBuffer, [meter.current])
2929
}, [audioBuffer, meter])
3030

3131
const handlePlay = () => {

docs/src/components/Example/VuMeterDefault.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ export const VuMeterDefault = () => {
2424
}, [])
2525

2626
React.useEffect(() => {
27-
if (!audioBuffer || !meter) return
28-
initPlayer(audioBuffer, [meter])
29-
}, [audioBuffer, meter])
27+
if (!audioBuffer || !meter.current) return
28+
initPlayer(audioBuffer, [meter.current])
29+
}, [audioBuffer, meter.current])
3030

3131
const handlePlay = () => {
3232
if (!player) return

docs/src/components/Example/VuMeterStereo.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ export const VuMeterStereo = () => {
3030
}, [])
3131

3232
React.useEffect(() => {
33-
if (!audioBuffer || !meter) return
34-
initPlayer(audioBuffer, [meter])
35-
}, [audioBuffer, meter])
33+
if (!audioBuffer || !meter.current) return
34+
initPlayer(audioBuffer, [meter.current])
35+
}, [audioBuffer, meter.current])
3636

3737
const handlePlay = () => {
3838
if (!player) return

docs/src/components/Example/WaveformDefault.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ export const WaveformDefault = () => {
5858
<section className="w-full flex flex-col justify-center items-center">
5959
<Waveform
6060
data={data}
61-
audioDuration={audioDuration}
61+
audioDuration={audioDuration.current}
6262
percentage={percentage}
6363
onClick={handleClick}
6464
/>

0 commit comments

Comments
 (0)