Skip to content

Conversation

perrin4869
Copy link
Contributor

This solution is an improvement over the createElement method in that it passes eslint-plugin-react problem jsx-eslint/eslint-plugin-react#512, and that conceptually, I think a middleware is the place to do these kind of manipulations.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extraProps => ({
  renderRouteComponent: child => React.cloneElement(child, extraProps)
})

@perrin4869
Copy link
Contributor Author

Maybe it's a good idea to mention that you can access the route object from routeComponentProps here? Since you could store extra props for specific routes there.

@taion
Copy link
Contributor

taion commented Apr 27, 2016

That can be covered in other docs. It's not relevant for the purposes of this discussion and will e.g. fail most linting rules.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please drop routeComponentProps here.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

This solution is an improvement over the `createElement` method in that it passes eslint-plugin-react problem jsx-eslint/eslint-plugin-react#512, and that conceptually, I think a middleware is the place to do these kind of manipulations.
@taion taion merged commit 34ba72d into remix-run:master Apr 28, 2016
@taion
Copy link
Contributor

taion commented Apr 28, 2016

Thanks!

@lock lock bot locked as resolved and limited conversation to collaborators Jan 19, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants