rf-web/vendor/bundle/gems/rouge-3.12.0/lib/rouge/demos/tsx

18 lines
373 B
Plaintext
Raw Normal View History

2019-10-21 08:18:17 +00:00
class HelloWorld extends React.Component<{date: Date}, void> {
render() {
return (
<p>
Hello, <input type="text" placeholder="Your name here" />!
It is {this.props.date.toTimeString()}
</p>
);
}
}
setInterval(function() {
ReactDOM.render(
<HelloWorld date={new Date()} />,
document.getElementById('example')
);
}, 500);