-
Notifications
You must be signed in to change notification settings - Fork 58
Encapsulate code to connect LocationField to redux store #284
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Encapsulate code to connect LocationField to redux store #284
Conversation
landonreed
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just a couple of tweaks in #285
refactor(LocationField): refactor HOC for LocationField
| userLocationsAndRecentPlaces: [...user.locations, ...user.recentPlaces] | ||
| } | ||
| // Leave stateToProps.location completely unset unless includeLocation is true. | ||
| if (includeLocation) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@landonreed It is still necessary to leave the location prop unset, otherwise the IntermediatePlaceField and FavoriteLocation components will use the fixed null value as location.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah gotcha, thanks for the info. Could you include that in the comment above?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, updated in cae2ba7.
landonreed
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great, just one comment about updating that comment re includeLocation.
|
🎉 This PR is included in version 3.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
This P demonstrates a way to encapsulate the common code to connect styled
LocationFieldinstances to the redux store.@landonreed let me know what you think of this approach.