Created
October 17, 2018 07:50
-
-
Save lukewatts/030d12e95649b14ce91c3d5467ad4bf5 to your computer and use it in GitHub Desktop.
Medium Article - Use JSX with any MV* framework - Code Snippets - 16 - Reactbone.js
This file contains hidden or 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
import dom from 'jsx-render'; | |
const Reactbone = {}; | |
Reactbone.createElement = dom; | |
export class Component | |
{ | |
view(el) | |
{ | |
el.appendChild(this.render()); | |
} | |
render() | |
{ | |
throw new Error('Classes which extend Component must implement a render() method which returns JSX, VirtualDOM or HTML!') | |
} | |
} | |
export default Reactbone; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment