Functional API for Outlet HOC
#24
Closed
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.
Type: feature
The following has been addressed in the PR:
prettieras per the readme code style guidelinesDescription:
Introduces a change to the
OutletAPI to enable consumers more control over the nodes to render when anOutlet's route has been matched. Instead of providing a static widget, theOutletaccepts a function that returnsDNodes the same as a widgetsrenderfunction.Outletnow also accepts a generic argument to specify the properties required when using theOutletin the widget tree. These properties may exactly match the properties of the widget itself, but often widget properties are computed from properties from the router so theOutlets properties could be a subset. The outlets properties are passed as the render functions first argument and theOutletPropertiesare passed as the second argument to the render function.The render function also receives the "type" and a couple of helper function
isErrorandisExactto determine which widget is required to be rendered depending on the match type. Previously theOutletsupported this by overloading the first argument as an object ofmain,indexanderrortype widgets.Resolves: #60