Skip to content

Commit

Permalink
Adds comment to react example
Browse files Browse the repository at this point in the history
  • Loading branch information
mikaelbr committed Jul 7, 2016
1 parent 51cb48d commit 88500a0
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions examples/react-api.js
@@ -1,13 +1,14 @@
const React = require('react');
const { renderToString } = require('react-dom/server');

// Dynamically created. Does not need to be predefined by React
const { div, h1 } = requireApi();
console.log(renderToString(div({
children: h1({
children: `I don't play defence`
children: 'Some output'
})
})));
//=> <div data-reactroot="" [...]><h1>I don't play defence</h1></div>
//=> <div data-reactroot="" [...]><h1>Some output</h1></div>

function requireApi () {
return new Proxy({}, {
Expand Down

0 comments on commit 88500a0

Please sign in to comment.