I implemented a player like functionality with a playlist using redux (and even zustand) to achieve global access of the player. I created a slice with the current playing song, an array of songs in the playlist and actions to add a song to the playlist, skip a song, .... However, I encountered that for the first render (I have an useEffect hook to load the song, when the state of the current active song changes) the old song appears after a restart. This leads to playing the song without the user making any input. I added logs to the useEffect and printed the current active song, after starting playback, killing the app (going in background and killing the background process) and reoping the app and saw, that the useEffect get's triggered two times, one with the song before closing the app and one with null (indicating, that no song is in playback).
I expected, that the states of redux/zustand are completly resetted after killing and reoping the app. It seems like the "JavaScript part" of the react native app doesn't immediatly refresh after reoping the app and maintains the old state for ~10ms (or something in this time range).