Skip to content

Reseting Playlist Name #1

@cyouh95

Description

@cyouh95

Great idea to reset the playlist name to a default My New Playlist after saving a playlist!

Spotify.savePlaylist(this.state.playlistName, trackUris).then(() => {
this.setState({
playlistName: 'My New Playlist',
playlistTracks: []
});
});

But for this change to be reflected on your page, make sure to use the value attribute instead of defaultValue for your input element here:

<input defaultValue={this.props.playlistName} onChange={this.handleNameChange} />

In addition, you could use My New Playlist here in the initial state as well for consistency:

this.state = { searchResults : [],
playlistName : 'My Playlist',
playlistTracks: []
};

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