Your App.js methods are done right. I like that you don't mutate your state in addTrack or removeTrack. Nice job using the spread operator. I haven't seen anyone use the setState callback and use prevState when setting state. Nice job doing that. Not necessarily necessary but glad you are looking into the React docs.
Your App.js methods are done right. I like that you don't mutate your state in
addTrack
orremoveTrack
. Nice job using the spread operator. I haven't seen anyone use thesetState
callback and useprevState
when setting state. Nice job doing that. Not necessarily necessary but glad you are looking into the React docs.