JakubKoralewski / lets-watch-it-together-private

Unconnected fork of LWIT. Private for the duration of SCRUM project.
https://lets-watch-it-together-scrum.herokuapp.com
MIT License
1 stars 0 forks source link

Music overlap #27

Closed syrekable closed 3 years ago

syrekable commented 3 years ago

[bug] background music overlap

Summary

The background music plays just fine during the normal flow of the program, but if you decide to go back, the hell breaks loose.

Expected behaviour

Only one song at the time.

Reproduction steps

  1. Go to any new site by clicking 'NEXT'
  2. Return to previous site with 'BACK'
JakubKoralewski commented 3 years ago

idk xd

33

Most likely the issue was that since BackgroundMusic was a child of the AddFriends component, and AddFriends not only rerendered but it also got removed and added conditionally which caused not only a re-render of BackgroundMusic but a whole teardown which is why I think useRef didnt help cause it should have helped with re-renders.