[Deprecated] Relay Classic integration for React Router


40 Versions


  • Breaking: Update for Relay v1.x API moves (#237)


  • Chore: Fix peer dependency ranges (#236)


  • Chore: Further update for React 15.5 deprecations (#233)


  • Chore: Update for React v15.5 deprecations (#231)


  • Bugfix: Only use legal characters in query config name (#197)


  • Bugfix: Use PropTypes.element instead of PropTypes.node where an element is expected (#185)
  • Chore: Add module entry point for webpack 2 (#186)


  • Bugfix: Improve error reporting when route with queries does not specify a component (#165)


  • Feature: Pass the base route element into the render callback as element, to better support dynamic route components and composition with other router middlewares (#154)


  • Bugfix: Missing Relay props should be null, not undefined (#148)


This is the same code as v0.13.0-rc.4. These release notes cover all changes since v0.12.2.

  • Breaking: Use <Relay.Renderer>-style API (#135)
    • Routes now take a single render callback instead of separate per-status callbacks, with similar semantics to <Relay.Renderer> (#135)
    • render callback also receives a routerProps object with the router props, even when Relay props are unavailable (#143)
    • <Router> object now requires an environment prop with the Relay environment (#135)
  • Breaking: Drop queryParams and stateParams in favor of an updated prepareParams (#137)
    • prepareParams now receives the router state as the second argument instead of the route (#141)
    • Fix handling of prepareParams for nested routes (#137)
  • Feature: Set route object as function context for route methods (#140)


  • Feature: Add routerProps to render argument object that always has the router props (#143)
  • Bugfix: Do not pass props to render when data are not ready (#143)


  • Breaking: Call prepareParams with router state instead of location (#141)
  • Feature: Set route as function context for route methods (#140)


  • Bugfix: Include params from non-Relay routes (#139)


  • Breaking: Use <Relay.Renderer>-style API (#135)
  • Breaking: Drop queryParams and stateParams in favor of an updated prepareParams method that now receives location instead of route for adding additional params (#137)


  • Minor: Add ES module build


  • Bugfix: Pass route props to renderFetched
  • Minor: Upgrade to Babel 6


  • Breaking: Rewrite as router middleware (#128)


  • Breaking: Move back to React Router (#122)


  • Feature: Allow specifying getQueries function for dynamic Relay queries (#120)


  • Feature: Allows specifying renderFailure, renderLoading, and renderFetched as objects keyed by component name (#177)


  • Breaking: Move from React Router to rrtr


  • Feature: Support non-scalar Relay route parameters from prepareParams


  • Bugfix: Pass the component key to the wrapped createElement function in <RouteContainer>


  • Bugfix: Fix forwarding props into route components


  • Minor: Fix a publishing error in v0.9.1


  • Feature: Add support for named components, courtesy @denvned


  • Breaking: Support React Router v2.x instead of v1.x


This is a relatively big release with significant breaking API changes.

The main change in this release is to move to a new top-level API made possible by new features in React Router. Now, instead of specifying createElement, you active the Relay integration by using <RelayRouter> or <RelayRoutingContext> as appropriate. This change lets us do a couple of new things:

  • We now support async components resolved via getComponent
  • We have a way to pass additional props like forceFetch to the Relay.RootContainer

There are a couple of smaller fixes included as well:

  • We preserve the signature of query functions, which fixes a bug when using non-shorthand queries against Relay v0.5.0
  • We now pass through readyState to the renderFetched handler as well


This updates the dependency versions for Relay and React Router.


Thanks to @josephsavona, we now have support for an additional prepareParams property on routes. Similarly to prepareVariables on a Relay container, prepareParams allows you to modify the params used for the Relay route. For example, you can use prepareParams to convert URL and query parameters from strings, and to initialize missing params with default values.

We've also bumped the React dependency from v0.14.0-rc1 to the final v0.14.0 release.


In some cases, the previous logic for generating unique query names based on referential equality of routes would break due to the route objects changing. This would lead to routes getting stuck in renderLoading forever due to changes in the generated unique query names. This release adds support for explicitly named routes, which allows us to match query names even when the route objects break referential equality.


  • Add support for Relay route parameters coming from location state
  • Only update the Relay route on actual location changes


This brings the package up-to-date with the recent changes in each of the major dependency packages.


This release adds hasVariable to RouteAggregator, which provides support for future releases of Relay that require this method on containers.


This release fixes the React Router peer dependency. We're only compatible with React Router 1.0.0-beta3 for now.


  • Match the new requirements for Relay containers in v0.2.1
  • Support using the same query for multiple routes


This adds back support for the case where a route component's parent calls React.cloneElement to inject additional props into the route component by passing through props into the wrapped component from containers.


Added a missing babel-runtime dependency.


We're now react-router-relay (instead of relay-nested-routes)!

@taion did some great refactoring with help from @cpojer to simplify the library while making it support more use cases.

Nested routes and queries are still aggregated up to a single Relay.RootContainer and dispatched in one go for batching and server side rendering, but now it's possible to provide RootContainer-esque functions on a per route basis like renderLoading, renderFetched, and renderFailed, in order to customize the experience for your app.

Thank you @taion and @cpojer for all your hard work!