Relay modern with routing example
Closed this issue · 7 comments
Is there an example app that uses Relay Modern with some sort of routing in between pages? If not, is there another repo where I can find something similar?
See https://github.com/taion/relay-todomvc, specifically https://github.com/taion/relay-todomvc/tree/found-modern (Relay Modern) and https://github.com/taion/relay-todomvc/tree/found-modern-universal (Relay Modern + SSR).
thanks for the example, I'm searching a route library too.
the isomophic-relay-router
used previously
I think @taion was pointing at 'Found' as the route library. Also, I am using relay modern with react router 4 without issue. Granted the app I'm using it on isn't huge so there may be some hurdles with a large app.
That's correct. Use Found. RRv4 doesn't give you a good way to handle nested queries.
Could you elaborate on that, what is the issue you are thinking of?
If you need to nest routes that require Relay data, with RRv4, you're stuck nesting <QueryRenderer>
s, which (1) gives you request waterfalls and (2) doesn't easily allow SSR.
Ah, I see. Yeah, my routes just end up looking like this:
<Route
path={"/nested/:thingId/thing"}
component={props => <Thing data={data} {...props} />}
/>
And that is how I orchestrate my fragment containers.