darul75/web-react

Example with prefetched data

chrissm79 opened this issue · 2 comments

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!

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

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!!!