Last active
August 29, 2015 14:07
-
-
Save leebyron/0ffac598b74ff4c6e823 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var data = {...} | |
var react = React.renderComponentToString(<Component data={data} />); | |
writeToClient( | |
'<html><head><script src="myCompiledJS.js"></script></head>' + | |
'<body><div id="foo">' + react + '</div>' + | |
'<script>React.renderComponent('+ | |
'Component({data:'+ JSON.stringify(data) + '}), document.getElementById("foo")'+ | |
')</script>' + | |
'</body></html>' | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment