Last active
August 29, 2015 14:24
-
-
Save JedWatson/40fe0e4fa393ba943bf9 to your computer and use it in GitHub Desktop.
React.renderComponentToStringAndCSS
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 MyComponent = React.createComponent({ | |
render () { | |
return <div style={{ color: 'blue' }}>Hello World</div>; | |
}); | |
var page = React.renderComponentToStringAndCSS(MyComponent); | |
// value of page: | |
page = { | |
html: '<div className="__a" data-reactid=".abc" data-react-checksum="123" data-react-classname="__a">Hello World</div>', | |
css: { | |
__a: 'color:blue;' | |
} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment