darul75 / web-react

:diamond_shape_with_a_dot_inside: Another React Dev Kit with Webpack and NodeJS
https://react-web.herokuapp.com/
81 stars 8 forks source link

Example with prefetched data #10

Closed chrissm79 closed 9 years ago

chrissm79 commented 9 years ago

I just started digging into React and this is by far the easiest starter kit I've come across while including all the essential features. However, I've yet to come across how to prefetch data w/ Alt and react router for server side rendering. It would be great if such an example could be included in this repo!

darul75 commented 9 years ago

Thank you for this comment, so nice to hear. You can bootstrap your application by feeding your store with some data, one example is given here : https://github.com/darul75/web-react/blob/master/server/utils/renderer.js not sure it is what you mean but it could ;) in that case it just feed with one todoitem fake value

chrissm79 commented 9 years ago

Thanks for the quick response! This definitely gets me going in the right direction. I also just stumbled across this test that uses a DataSource, registerAsync, and Render.withData(). Not sure if this allows me to get around redefining routes on the express server but at least I know where I can feed in data to my stores using your example. Thanks!!!