Skip to content
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

Passing Additional Data to prepareParams #64

Open
sjeanat opened this issue Nov 30, 2016 · 1 comment
Open

Passing Additional Data to prepareParams #64

sjeanat opened this issue Nov 30, 2016 · 1 comment

Comments

@sjeanat
Copy link

sjeanat commented Nov 30, 2016

We have a very similar set up to @ianstormtaylor's question in relay-tools/react-router-relay#58. How would you suggest we get the cookie information (or any other non-url related data) into the prepareParams method? As of right now, the second argument (not sure what to call it) in prepareParams seems to only return the following properties:

{
routes,
params,
location,
components,
router,
matchContext
},

Placing the data we need within one of the properties above works, but we feel this may not be the best way to approach this. To begin with, none of those properties seem to have any reference to any data that is not extracted from the url/route. Is there something we're missing?

@minheq
Copy link

minheq commented Dec 1, 2016

I think you can possibly just pass it by passing down to route components as props
Here I define the data I want to pass inside the component

image

And here I pass it to component
image

And the rendered component will contain the data from route props

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants