Conversation
Allow custom `removePath` values to contain route params. This behavior matches the automatic `removePath` creation logic.
Remove the previousPath reducer and related conditional `router.goBack` logic. This never really worked correctly in practice since using the back function of history leaves the reducer with the wrong `previousPath` value (actually the "next" path). A proper solution would be to store an array of location history, and push or pop the location on navigation. It's better to just keep things simple.
Remove previousPath related logic.
All of the `relocation` connector config can be assigned as props on the connected component instance or configured within the call to the `relocation` connector. Instead of taking separate render map and config parameters, the connector now takes a single default props object. The render map can be defined within as `components` or can be provided as a `components` prop on the rendered instance. In addition an optional `scope` option allows namespacing the consumed and generated props. This is designed to prevent conflicts with existing props on the connected component and allows composition with multiple `relocation` connector calls on the same component.
Refactor connector config and introduce scope.
Remove the `Children.only` check in the `RelocationRouter` render method. It is perfectly valid to have zero or more children here. This was only causing problems.
Prevent unwanted `relocation` specific props from getting passed down to the connected component.
Remove unwanted props from connected component.
Remove child restriction on RelocationRouter.
Allow param interpolation in removePath.
Remove the prop merging magic from the selectors. The original intention was to allow multiple instances of a component with a given id to exist, but to have them collapsed down and merged in the selector. This would have been useful for a component that was the product of props from a route component _and_ a dispatched component. However the complexity this added far outweighed the benefit, and the behavior was not intuitive. The new version of `addComponent` no longer has the option for a custom id, and will not result in props merging with existing components. A new `setComponent` action is used when the id must be explicitly specified. If an existing component with the given id exists, it is replaced rather than merged on to. What does remain of the component merging logic is a new `updateComponent` action that can be used to update the props of an existing component. Props dispatched in the `updateComponent` _are_ merged into the existing props of the component with the matching id. An `update` function is also now included alongside the `remove` function on each component returned through the connector. This offers an interface for updating the "state" of the component where `update` is used like react `setState`.
Simplify actions and selectors.
Add missing propTypes.shape call.
Remove `RelocationRouter` component and related logic from state and connect component. Tightly binding this lib to React Router is not the best idea. The behavior removed here can be easily replicated by manually dispatching `setComponent` from the `componentWillMount` and `removeComponent` from the `componentWillUnmount` method of a route handler component.
Remove React Router integration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add recent changes from
nextintomaster./cc @izaakschroeder