frbec / jammming Goto Github PK
View Code? Open in Web Editor NEWCodecademy non-guided project. Music playlist creation app using Spotify API.
Codecademy non-guided project. Music playlist creation app using Spotify API.
Great job with the React fundamentals. You update state where you should using setState
. You also pass all the right props to the child. Lastly, you use the child components to render specific parts of the application. Nice work.
You did a good job on your project. You components had all the right methods in them and did what they were suppose to. Nice work on your Spotify.js file, that can definitely be challenging. Also, good work setting state, passing props and using the child components. Be careful not to mutate your state and you should be doing great. Nice job on your project.
Nice job with your Spotify.js file. A lot of users get really caught up on this good job making it through. I really like the comments you added. It helps me as a reviewer understand what the code does more quickly. Also, it makes for a good reminder if you were to come back to the code after a long time passed.
You have this code in your App.js -> addTrack method:
addTrack (track) {
let newState = this.state.savedTracks
newState.push(track)
this.setState({ savedTracks: newState })
}
Here, you are trying to get a new copy of state but that won't work. newState
is a direct reference to this.state.savedTracks
meaning anything you do to one you do to the other. Instead you want a new copy by doing either of the following:
let newState = this.state.savedTracks.slice();
let newState = [ ...this.state.savedTracks ];
Either one will do the trick. Slice returns a new array, as does the spread operator.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.