You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First thanks for the course, I've been watching it on egghead and checking the recompose repo learning from the API docs as well. In fact I landed in this repo from this particular issue on recompose:
Unfortunately there are some advanced ES2015+ concepts that I haven't grasped completely yet, this question stems from that fact and a lack of real examples in the recompose docs.
The fact is that I don't quite understand why the arguments in the mapper must go between curly braces:
constfilterByStatus=mapProps(({users, status})=>({
status,users: users.filter(u=>u.status===status)}));// then create the new component using the baseconstActiveUser=filterByStatus(UserList);// finally on the main <App /> component<ActiveUserusers={users}status="active"/>
I get that the users and status are props of the base component, so we need to wrap them between curly braces in order to access them like this?:
props.statusprops.users
In the same subject, could it be possible, since the params passed to the mapper are all the props passed to the <ActiveUser /> component, could it be possible to just spread the props on the mapper function?
Hi Tim,
First thanks for the course, I've been watching it on egghead and checking the recompose repo learning from the API docs as well. In fact I landed in this repo from this particular issue on recompose:
acdlite/recompose#337
Unfortunately there are some advanced ES2015+ concepts that I haven't grasped completely yet, this question stems from that fact and a lack of real examples in the recompose docs.
The fact is that I don't quite understand why the arguments in the mapper must go between curly braces:
I get that the users and status are props of the base component, so we need to wrap them between curly braces in order to access them like this?:
In the same subject, could it be possible, since the params passed to the mapper are all the props passed to the
<ActiveUser />
component, could it be possible to just spread the props on the mapper function?Thanks again for the lessons and in advance for any answer or tip to become a better coder.
Best,
Rodrigo.
The text was updated successfully, but these errors were encountered: