-
Notifications
You must be signed in to change notification settings - Fork 44
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
Integration with relay-tools/react-router-relay. #21
Comments
This would be an awesome addition. If you'd like to lead this effort, it would definitely be welcome! Feel free to get in touch on Discord. At first sight it looks like react-router-relay is just a applyMiddleware = (RouterContext) => (...middleware) => (); 🍺 |
Correct me if I am wrong, but it seems the It matches the signature as it provides I don't think there is any dependency to ryanflorence/react-router-apply-middleware. |
I wonder if If done well, the final code with relay will look like the following: import Relay from 'react-relay';
import useRelay from 'react-router-relay';
import {
useNative,
nativeHistory,
TabsRoute
} from 'react-router-native';
import {
Router,
Route,
applyRouterMiddleware
} from 'react-router';
/* ... */
const AboutQueries = {
about: () => Relay.QL`query { about }`
};
const router = (
<Router
history={nativeHistory}
render={applyRouterMiddleware(useNative, useRelay)}
environment={Relay.Store}
addressBar
>
<TabsRoute
path="app"
component={App}
transition="horizontal-pager"
>
<Route
path="/"
component={About}
queries={AboutQueries}
overlayComponent={AboutHeader}
/>
</TabsRoute>
</Router>
); |
You're right. I wasn't aware of this—looks like that was merged to master as of v2.3.0. Either way, we would have to have full control over I just created a PR that adds 🍺 |
I need some time to really learn how routers work. I took some time last night, but there seem to be lots of things to learn. I will spend next few days digging sources, and will update this thread as I make any progress. |
I like how this project reuses react-router, and I think this is the right direction for true code sharing between native apps and web.
I want to open an issue for integration with react-router-relay as well.
I'm not sure if it would work out of box as is now, but I will play with it soon to see whether it needs some modifications.
The text was updated successfully, but these errors were encountered: