-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Great idea to reset the playlist name to a default My New Playlist after saving a playlist!
playlistHero/src/components/App/App.js
Lines 46 to 51 in d05abe6
| 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:
playlistHero/src/components/App/App.js
Lines 16 to 19 in d05abe6
| this.state = { searchResults : [], | |
| playlistName : 'My Playlist', | |
| playlistTracks: [] | |
| }; |
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels