Created
February 12, 2015 08:57
-
-
Save goatslacker/9277b9f8960bcafbaba2 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
function render(SomeElement, state) { | |
if (typeof window === 'undefined') { | |
let htmlMarkup = React.renderToString(React.createElement(SomeElement, state)) | |
return Iso.render(htmlMarkup, state, { id: 'hello' }) | |
} else { | |
Iso.on('id', 'hello', function (state, meta, node) { | |
React.render(React.createElement(SomeElement, state), node) | |
}) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment