summaryrefslogtreecommitdiff
path: root/vendor/bundle/ruby/3.4.0/gems/rouge-4.5.2/lib/rouge/demos/tsx
blob: 422d2a732513bdad06090b948462c521a03d293d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
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);