Created
January 1, 2015 18:12
-
-
Save tildedave/81f981558b3cd4f8d1bd 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
dave@margaret:~/workspace/isomorphic-react-without-node/duktape-1.0.2$ ./duk init.js react-0.12.2.js test.js | |
<div data-reactid=".1n7svbvilrt" data-react-checksum="1140200483">This is my content</div> |
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
// Forces React into node.js mode | |
var global = {}; | |
function consoleShim() { | |
print(Array.prototype.join.call(arguments, ' ')); | |
} | |
var console = {}; | |
['debug', 'log', 'info', 'warn'].forEach(function(i) { | |
console[i] = consoleShim; | |
}); |
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 React = global.React; | |
var A = React.createClass({ | |
render: function() { | |
return React.DOM.div(null, 'This is my content'); | |
} | |
}); | |
console.log(React.renderToString(React.createElement(A))); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment