Skip to content

Instantly share code, notes, and snippets.

@tbranyen
Last active January 12, 2017 00:11
Show Gist options
  • Save tbranyen/48c0f4c1aa8bdddcbf63ace4d27e2fd2 to your computer and use it in GitHub Desktop.
Save tbranyen/48c0f4c1aa8bdddcbf63ace4d27e2fd2 to your computer and use it in GitHub Desktop.
diffHTML working out-of-the-box with JSX
import { createTree, innerHTML } from 'diffhtml';
class Display {
render({ message, children }) {
return [
<li>{message}</li>,
...children,
];
}
}
const App = state => (
<ul>
<Display {...state}>
<li><b>Test</b></li>
</Display>
</ul>
);
innerHTML(document.body, <App message="Hello world" />);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment