DavidWells / isomorphic-react-example

Deprecated! ReactJS + NodeJS ( express ) demo tutorial with video. Universal/Isomorphic JS = Shared JavaScript that runs on both the client & server.
http://davidwells.io
MIT License
1.69k stars 272 forks source link

fake data is included with browserify bundle #1

Open ryanramage opened 9 years ago

ryanramage commented 9 years ago

Over the last couple days I have been working on isomorphic react, and then I stumbled on your example. One issue I see is that the fake data file is bundled with the browserify build and shipped with the js the browser loads. Most apps will retrieve the data at runtime from a store or api and wont be able to do this.

It would be nice if isomorphic-react-example could show loading data from some public api and rendering that serverside and then having the client mount that component.

So far the only way I have found to deal with this is to JSON.stringify the data on the server included in the html, and then on the client JSON.parse the data and pass it to the ReactApp component.