Open mvaivre opened 8 years ago
you could put your own middleware in (before useRelativeLinks()
) that does the cloning
Actually I've run into this again, now I realize, RelativeLinksContainer
should be transparently passing extra props along to its children, as should any other middleware containers, so that everything behaves the same as if the unwrapped child route component is cloned.
First of all, thanks for this very useful middleware! Don't know if it's better to create an issue here or in the react-router repo, but anyway:
It seems that using
cloneElement
to pass more props tothis.props.children
is not working when a middleware like react-router-relative-links is used.The new layer
RelativeLinksContainer
that uses acreateElement
method to render the final component seems to prevent us from modifying the props set.