When you save a playlist, the playlistTracks and playlistName should both be reset. searchResults should probably not be reset since the search could still be useful to the next playlist.
However, it is considered a poor practice for a React class method to use this.setState more than once. Instead of calling this.updatePlayListName, you should just update all state in a single this.setState.
Rather than using a defaultValue attribute, just use a value attribute. And instead of giving it a value of {'New Playlist'}, you should use {this.props.name} which is getting passed down from the App component. That way the value of the form will always reflect what is passed down via props and you can properly reset the playlistName value.
https://github.com/liftedpixel/jammming/blob/master/src/components/App/App.js#L38-L39
When you save a playlist, the
playlistTracks
andplaylistName
should both be reset.searchResults
should probably not be reset since the search could still be useful to the next playlist.However, it is considered a poor practice for a React class method to use
this.setState
more than once. Instead of callingthis.updatePlayListName
, you should just update all state in a singlethis.setState
.https://github.com/liftedpixel/jammming/blob/master/src/components/Playlist/Playlist.js#L19
Rather than using a
defaultValue
attribute, just use avalue
attribute. And instead of giving it a value of{'New Playlist'}
, you should use{this.props.name}
which is getting passed down from the App component. That way the value of the form will always reflect what is passed down via props and you can properly reset theplaylistName
value.