stefem / jammming

CodeAcademy project
0 stars 0 forks source link

Searching for tracks #3

Open ghost opened 6 years ago

ghost commented 6 years ago

https://github.com/stefem/jammming/blob/master/src/components/App/App.js#L53-L57

Nice job remembering that the Spotify.search() method returns a Promise and properly chaining a .then() before setting your state 👍

Consider renaming the tracks variable to searchResults so that you can benefit from using ES6's property/value shorthand syntax here:

this.setState({ searchResults })

You can use this whenever you need an object whose key is the same its value (i.e. { searchResults: searchResults } ) and you might find it makes your code more terse.