Skip to content

Giving a null issue onDestroy #544

@Prasundas99

Description

@Prasundas99

Version

"react-jinke-music-player": "^4.24.2",
"react": "^18.2.0",

Description

Getting this error when i destory a player using the (X) cross button and then play a new song

image

const MusicPlayer = ({ audioLists = [], currentSongIndex = "" }) => {
  const playIndex = audioLists.findIndex(
    (song) => song.id === currentSongIndex
  );
  return (
    <ReactJkMusicPlayer
      audioLists={audioLists ?? []}
      mode="full"
      theme="dark"
      autoPlay={true}
      toggleMode={false}
      showThemeSwitch={false}
      showDownload={false}
      showReload={false}
      playIndex={playIndex ?? 0}
      showDestroy={true}
    />
  );
};

Expected Behavior

It should play the new song

Current Behavior

image
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions