Questions tagged [react-router-relay]

react-router-relay is a tool used for integrating the react-router library into a Relay.js environment. Use this tag when using the react-router-relay library in your project.

react-router-relay (not to be confused with react-router) is a tool used when integrating the react-router library into a Relay.js environment.

react-router-relay will automatically generate a combined Relay query config with all queries and parameters from the active React Router routes, then pass down the query results to each of the route components.

Useful links

react-router-relay on GitHub

react-router-relay on npm

Related tags

46 questions
16
votes
2 answers

Augment react-router module with react-router-relay typings

The default react-router is used as such: import * as React from 'react'; import { Router, Route, hashHistory } from 'react-router'; const routing = (
Peeter
  • 8,952
  • 4
  • 34
  • 52
13
votes
1 answer

How to wire data to a deep component in react-router-relay?

I have a route like this The basic Search component looks likes this class Search extends React.Component { constructor (props) { super(props) this.state = {query: ''} } handleSubmit (event)…
Thank you
  • 107,507
  • 28
  • 191
  • 224
12
votes
1 answer

Relay: How to merge instead of override queries in nested routes?

I cannot navigate to /users in my app, because it doesn`t trigger fetching of all queries that I would expect it should. My app consists of an App component and some components that contain actual content like Dashboard or UserList. There is also…
Michael Hilus
  • 1,316
  • 1
  • 17
  • 37
7
votes
2 answers

Access React component from this.props.children with react-router

I have a website with the following react-router and react-router-relay setup: main.jsx:
Chris
  • 48,555
  • 16
  • 95
  • 112
6
votes
1 answer

Relay/router login mutation?

I'm trying to implement a mutation for login. The mutation validates the provided id_token and logs the user in via sessions. The mutation itself works (verified with GraphiQL), but I'm having issues integrating it with Relay. When a user logs in,…
Sam P
  • 1,728
  • 11
  • 25
5
votes
2 answers

How to pass variables between Relay Containers

I'm looking for the good syntax to pass a variable from a parent container to a child container. Let's say I have theses routes, with a global widget list on / and specific widget lists on /widgets/:WidgetListID. Note: I use…
Victorien
  • 181
  • 1
  • 7
4
votes
1 answer

How to make Relay and React Routing work properly?

I am starting out with Relay and trying to make my routing work properly. Unfortunately, I am not having much of luck. Here is the error I am getting: Uncaught TypeError: Component.getFragment is not a function Here is the code I have for your…
Moon
  • 27,583
  • 17
  • 73
  • 122
3
votes
0 answers

How to detect relay environment change if react-router-relay is used?

Perhaps this is very specific question, but i believe it would be find to find solution. I find a lot of people ask about environment change after login/logout. I'm using redux to store app state logic about login, modals, forms etc. and relay for…
M.Svrcek
  • 5,050
  • 3
  • 21
  • 33
3
votes
1 answer

Update react-router and react-router-relay to v2.x from v1.x (Location "/" did not match any routes)

I'm trying to update react-router to v2.6 and react-router-relay to v0.7 in my app but I'm struggling to follow the changelogs to address all breaking changes. I think I addressed all changes but I still can't make it work. Warning: [react-router]…
alengel
  • 2,679
  • 3
  • 18
  • 26
3
votes
0 answers

Pass loading state props to root component with Relay

This seems like a basic idea but I can't seem to wrap my head around it. In Redux, defining what happens to the store and which props I pass to components is entirely up to me. In Relay, I can define a render function in my container where I return…
azium
  • 17,620
  • 5
  • 44
  • 73
3
votes
1 answer

Sub route queries error for react-router-relay

Part of my route is set up like so: Relay.QL`query { viewer }`, widget: () => Relay.QL`query { widget(widgetId: $widgetId) }` }}>
jouerai
  • 135
  • 8
3
votes
1 answer

react-router-relay: handle sucess or error on mutation

What's the best way to handle success or error after a mutation? I'm using React.js and react-router-relay to make graphQL queries and mutations. Let's say I have a React component performing a Rename mutation. I'd like to have a user callback…
2
votes
2 answers

React relay injectNetworkLayer is not a function

I am following the tutorial from lynda: "Building and Deploying a Full-Stack React Application", in the chapter "Injecting the Relay Network Layer". there is in index.js, an attempt to set up a network layer, and the program compiles successfully…
WB Lee
  • 311
  • 1
  • 3
  • 10
2
votes
0 answers

How to cache already loaded data and stored in Relay?

I have some panel (A) showing a list of events. The panel initially loads 10 items. The user can load more items by clicking a button. The processing is handled by loadmore(). loadmore() also updates variable first' value in state and sessionStorage…
Scholle
  • 1,519
  • 1
  • 20
  • 43
2
votes
0 answers

Changing variables of query in progress with relayjs

Is it possible to somehow change the query variables for query in progress? My idea is that I'm storing number of showed items in route state with variable called pageSize. Now when user opens one item and press back button in browser, I will show…
M.Svrcek
  • 5,050
  • 3
  • 21
  • 33
1
2 3 4