{"size": 777, "ext": "js", "max_stars_repo_path": "demo/index.js", "max_stars_repo_name": "AkiDroid/preact", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "demo/index.js", "max_issues_repo_name": "AkiDroid/preact", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "demo/index.js", "max_forks_repo_name": "AkiDroid/preact", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 17.2666666667, "max_line_length": 61, "alphanum_fraction": 0.592020592}
import { createElement, render, Component, h } from 'preact';

function Room(props) {
	console.log('room update', props.name)
	return <div>{props.name}</div>;
}

class Home extends Component {
	constructor(props) {
		super(props);
		this.state = {
			count: 1,
			bName: 'b'
		};
	}

	handleClick = () => {
		this.setState({
			count: this.state.count + 1,
		});
	}

	render() {
		return (
			<div>
				<button onClick={this.handleClick}>bb</button>
				<Room name={this.state.bName} />
			</div>
		);
	}
}
// let vnode = (
// <div>
// <Home msg="hello msg"/>
// <Home msg="hello msg"/>
// </div>
// );
let vnode = h('div', {}, [h(Home, { msg: 'hello msg' })]);
console.log(vnode);

let app = document.createElement('div');
document.body.appendChild(app);

render(vnode, app);
