Comments (5)
@RickWong any thoughts or guidance on this?
Seems similar to RickWong/react-transmit#10
Which dosen't look like it was properly resolved
from react-isomorphic-starterkit.
Hi @kevzettler I would recommend writing a new ConnectHandler
component that handles the route, captures the id, then renders <Connect queryParams={{id}} />
. It functions as a bridge between React Router and the Transmit component.
Although it's one more component to write, it does separate routing from the Connect component. Doing it like this, enables you to re-use the Connect component somewhere else with another id.
from react-isomorphic-starterkit.
Hi @RickWong,
Maybe I'm missing something, but your workaround doesn't seem to work for me. Here is what I did
// Routes
<Route name="user" path="/user/:userId" handler={IdProxy} />
// in IdProxy
render() {
return <User userId={this.props.params.userId} />
}
// in User (ES6 syntax)
class User extends React.Component {
render() {
const user = this.props.user;
console.log('p: ', this.props);
return <div/>;
}
}
export default Transmit.createContainer(User, {
queries: {
user(queryParams) {
console.log('qp: ', queryParams);
return new Promise((resolve, reject) => {
resolve(1);
});
}
}
});
This still ends up with the props containing the userId but the queryParams being blank. If I need to load a user in the queries, I cannot without the userId.
from react-isomorphic-starterkit.
You should render the User like this: <User queryParams={{userId: this.props.params.userId}} />
. See this DOCS section HOC PropTypes.
from react-isomorphic-starterkit.
Thanks for clarifying :)
from react-isomorphic-starterkit.
Related Issues (20)
- hot reloading client side not working
- Timed out waiting for dist/*.js after 30 seconds HOT 2
- Internal Server Error when running npm run watch HOT 3
- React-router example
- Location object does not get passed to components server side.
- Had to downgrade to Node v5 for `npm run watch` to work HOT 4
- Images not loading in Webpack build
- Heroku deployment is not working simple express app
- 帅哥,服务端渲染的原理是什么?
- General questions about react-transmit usage within this kit HOT 2
- `Server-side React render was discarded` after migrating to express HOT 1
- Passing custom data (e.g. token) to props during server-side render HOT 1
- Nested containers (with getFragment) prevents server from rendering HOT 3
- npm run watch fails after update to webpack 2 HOT 1
- Doesn't work HOT 1
- Help? It fails to start
- All done but nothing works HOT 3
- Operand to 'typeid'
- not working HOT 2
- does not work out of the box
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-isomorphic-starterkit.