-
Notifications
You must be signed in to change notification settings - Fork 1.3k
reverse props spread order for mapPropsOnChange #102
Comments
Yes this was an oversight. It can be fixed by flipping lines 25 and 26. A PR would be great :) |
For simplicity with line switch, omit on line 26 also can be removed. Otherwise it works like |
@istarkov it appears |
I meant that omit filtering was done because of merge order, if you switch lines 25 and 26, looks like there is no need to filter (omit) props taken from array. |
I have the PR pretty much ready to go, but trying to run the tests local and they are currently failing with: I think it is related to facebook/relay#889, and when they publish a new version it may be fixed. I may just submit the PR and see if the travis build fails. |
While working with
mapPropsOnChange
recently we noticed thatthis.props
get spread overcomputed props
.https://github.com/acdlite/recompose/blob/master/src/packages/recompose/mapPropsOnChange.js#L24
It appears the original plan was to spread computed props last?
#60 (comment)
Example:
I create an
items
prop withmapPropsOnChange
but if
items
was already a prop being passed down the new computed prop ofitems
will get overwritten bythis.props.items
.I would expect my outputted computed props to be what gets passed down.
Let me know what you think, and I could get a PR in with tests this week.
The text was updated successfully, but these errors were encountered: