├── README.md ├── index.html └── index.js /README.md: -------------------------------------------------------------------------------- 1 | # Bundleless-react 2 | Using React with UMD builds. 3 | 4 | --- 5 | Did my code make a difference to your project? Consider buying me a coffee!
Buy Me A Coffee -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | Bundleless React 7 | 8 | 9 |
10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /index.js: -------------------------------------------------------------------------------- 1 | const rc = React.createElement; 2 | 3 | class VisitContainer extends React.Component { 4 | constructor() { 5 | super(); 6 | this.state = { 7 | counter: 0 8 | } 9 | } 10 | 11 | incrementCounter(counter) { 12 | this.setState({ 13 | counter: counter+1 14 | }) 15 | } 16 | 17 | render() { 18 | return rc( 19 | 'div', 20 | null, 21 | [ 22 | rc( 23 | 'h3', 24 | null, 25 | this.state.counter 26 | ), 27 | rc( 28 | 'button', 29 | {onClick: () => this.incrementCounter(this.state.counter)}, 30 | 'I clicked here !!!' 31 | ) 32 | ] 33 | ); 34 | } 35 | } 36 | 37 | ReactDOM.render( 38 | rc(VisitContainer), document.getElementById('visit_container') 39 | ); --------------------------------------------------------------------------------