mirror of
https://github.com/usenocturne/nocturne-ui.git
synced 2026-04-25 07:45:52 +03:00
[PR #97] [MERGED] Prevent incessant rerenders while playing #118
Labels
No labels
help wanted
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nocturne-ui#118
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/usenocturne/nocturne-ui/pull/97
Author: @alvvaro
Created: 4/23/2025
Status: ✅ Merged
Merged: 4/23/2025
Merged by: @brandonsaldan
Base:
main← Head:alvvaro/fix-playbackcontext-rerendering📝 Commits (2)
f1dfb55remove PlaybackProgressContext7956e3eremove unused usePlaybackProgress import📊 Changes
5 files changed (+94 additions, -120 deletions)
View changed files
📝
src/App.jsx(+86 -90)📝
src/components/player/NowPlaying.jsx(+1 -0)📝
src/components/player/ProgressBar.jsx(+6 -14)📝
src/hooks/usePlaybackProgress.js(+1 -13)📝
src/hooks/useSpotifyData.js(+0 -3)📄 Description
This PR removes the top level
PlaybackProgressContextand unsubscribesuseSpotifyDatafromusePlaybackProgress, as both things were causing the whole App component to rerender many times per second while music was playing.The Context provided no value, since there was a circular dependency between it and the
usePlaybackProgresshook.Components that need playback information (e.g.
NowPlaying) should explicitely suscribe to the progress hook.PS: Best to look at the PR diff with whitespaces changes OFF
Before:

After:

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.