The way I do it: I use the same build for client-side and server-side
rendering, but on the server, instead of calling the regular main function
(which does history setup a.s.o), I just synthesize the desired state for
each page, build the top-level component directly and render-to-string.
That way, no code depending on the browser env gets called.
Any component dealing with the browser env does so in will/did-mount, which
doesn't get called from render-to-string either.

Granted, with this approach one has to be careful that the synthesized
state matches the actual inital state on the page, but that's so in any
case, plus react gives errors for ids in unexpected places.

hope that helps

-- 
Note that posts from new members are moderated - please be patient with your 
first post.
--- 
You received this message because you are subscribed to the Google Groups 
"ClojureScript" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojurescript+unsubscr...@googlegroups.com.
To post to this group, send email to clojurescript@googlegroups.com.
Visit this group at http://groups.google.com/group/clojurescript.

Reply via email to