Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Track steps are not properly removed/disposed when they change #42

Open
brandongregoryscott opened this issue Jan 19, 2022 · 0 comments

Comments

@brandongregoryscott
Copy link

brandongregoryscott commented Jan 19, 2022

It looks like the <Track /> component is not properly removing or disposing of steps when props change. I ran into this on my own project using reactronica, but I've reproduced the issue in a smaller sandbox environment: https://codesandbox.io/s/reactronica-42-step-duplication-bug-qnd8h?file=/src/App.tsx

To reproduce in the sandbox:

  1. Wait for the samples to load (Play button will be disabled until onLoad runs)
  2. Play the initial state of the Track which includes 4 hi-hat notes and a kick on the first step.
  3. Pause the track.
  4. Toggle the steps to be the hi-hat only set.
  5. Play the track again. (You should hear hi-hats only)
  6. Pause the track, and toggle the steps.
  7. Play the track - on this time around, you'll notice the kick and hi-hats sound louder. (as if they are layered on top of the original array of steps)
  8. Pause the track, then toggle the steps back to the hi-hat only set.
  9. Play the track - you will hear both the kick and hi-hats, and they sound even louder.

I've patched the issue in a branch of my fork (85405d7) which I've tested against my project using reactronica, but not this sandbox example. I imagine it will resolve it, too, but I'm not 100% sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant