Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trialshubhamvinay
3,741 Points(action.types) as the parameter value for the Player function...
How are we using that ? should it just not be (action) ?
Nicolas Hampton
44,638 PointsNicolas Hampton
44,638 PointsActually, action.types is the value being evaluated in the switch statement. The value being passed as the second argument of the player function is, as you said it should be, the action object. The type property on the action object is going to be one of the action type strings we defined in src/actiontypes/player.js. So, just for clarity, you should be looking at something like this as the first couple of lines of the Player reducer:
I hope that helps.