This repository has been archived by the owner on Mar 15, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 61
Passing props to Transmit #59
Comments
Maybe you need do something like this: const AuthRoutingContext = (props) => {
return (< RoutingContext {...props} variables={{auth: 'authstring'}}) />
}
Transmit.renderToString(AuthRoutingContext, renderProps).then(({reactString, reactData}) => {
...
}); And then export default Transmit.createContainer(RoutingContext, {
initialVariables: {
auth: ''
},
fragments: {
doSomething: ({auth}) => {
//Want to read my authstring here
}
}
}); |
It doesn't work. Am I missing something in my routes definitions?
|
You have to do the same, but in your AppWrapper in the router. const AppWrapperRouter = (props) => {
return (<AppWrapper {...props} variables={{auth: 'authstring'}}) />)
}
module.exports = (
<Router component={AppWrapperRouter}>
<Route path="/" component={Main} />
</Router>
); That will work for sure. |
The thing is that I need 'authstring' to come from the server. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi, I want to send props from the server to Transmit (I'm using the react-isomorphic-starterkit).
Si I have this on server:
And then in my component definition, I have the following:
The text was updated successfully, but these errors were encountered: