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
  • 9,282
  • 5
  • 36
  • 53
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)…
Mulan
  • 129,518
  • 31
  • 228
  • 259
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,647
  • 2
  • 21
  • 42
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
  • 57,622
  • 19
  • 111
  • 137
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,821
  • 13
  • 26
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

GraphQL with React Router Relay: Expected type Int, found String for numeric route

I have the following Router and routes using the react-router-relay package ReactDOM.render(
danronmoon
  • 3,814
  • 5
  • 34
  • 56
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
  • 33,439
  • 20
  • 81
  • 132
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,485
  • 4
  • 25
  • 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
  • 4,368
  • 3
  • 21
  • 28
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
  • 20,056
  • 7
  • 57
  • 79
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
  • 9
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
  • 641
  • 1
  • 6
  • 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,521
  • 2
  • 23
  • 44
1
2 3 4