Skip to content
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

Test out react-router-component #9

Closed
ericclemmons opened this issue Feb 24, 2015 · 8 comments
Closed

Test out react-router-component #9

ericclemmons opened this issue Feb 24, 2015 · 8 comments

Comments

@ericclemmons
Copy link
Owner

This looks like a cleaner implementation:

https://github.com/STRML/react-router-component

@adri
Copy link
Contributor

adri commented Feb 24, 2015

👍 for react-router-component (or in general being able to choose a router)

@ericclemmons
Copy link
Owner Author

If I can figure out how the heck to test out peerDependencies (and optionalDependencies), I might be able to get rid of the react-router requirement!

@adri
Copy link
Contributor

adri commented Feb 24, 2015

If the react-router is not used within react-resolver, why would you then even provide a router as peerDependency (or optionalDependency)?

Would it be feasible to create a wrapping/higher-order component (like described in #8) which sets the context? This component could then be used by a user of react-resolve to wrap around the App component.

@ericclemmons
Copy link
Owner Author

It's a requirement for maintaining contexts when using react-router:

return React.createElement(Route, {handler: ResolverContext}, routes);

At the time of inception, this was necessary for server-side rendering with react-router.

The goal would be, if this remains in, being able to have an optional dependency on it in the consumer project.

I can try replacing this with a wrapping component that's not a route, but I could've sworn I had to use a <Route />...

@ericclemmons
Copy link
Owner Author

Oh! But related to #10, I still need to set react as one of the peerDependencies, but I can't for the life of me figure out how to confirm this behavior w/o tagging & releasing & testing with a new project!

@adri
Copy link
Contributor

adri commented Feb 25, 2015

I really like where this project is going.

The goal would be, if this remains in, being able to have an optional dependency on it in the consumer project.

If it's used I suppose its not optional ;-)

As far as I see the <Route /> is basically a wrapper around the outmost (highes level) route handler from the user. The neat thing about extracting the context initialization in a wrapping component is, that react-resolver can then be used with any router (or none) out of the box.

@ericclemmons
Copy link
Owner Author

I'll be testing out react-router's stringent-ness on this :) Hopefully I can warp it in something other than a <Route />.

@ericclemmons
Copy link
Owner Author

Not necessary anymore with v1.0.0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants