From d4aec19c718356f2bbc7e294ca66dca9847cd1dd Mon Sep 17 00:00:00 2001 From: greg Date: Wed, 20 Sep 2017 23:46:46 -0700 Subject: [PATCH] web: CodeArea --- static/index.html | 4 ---- static/main.jsx | 29 ++++++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 5 deletions(-) diff --git a/static/index.html b/static/index.html index 4834a16..5eefd01 100644 --- a/static/index.html +++ b/static/index.html @@ -5,10 +5,6 @@
- Type your source code into here: - diff --git a/static/main.jsx b/static/main.jsx index fd4b1eb..10fa7ce 100644 --- a/static/main.jsx +++ b/static/main.jsx @@ -1,10 +1,37 @@ const React = require("react"); const ReactDOM = require("react-dom"); + +class CodeArea extends React.Component { + constructor(props) { + super(props); + this.state = {value: ""}; + this.handleChange = this.handleChange.bind(this); + this.submit = this.submit.bind(this); + } + + handleChange(event) { + this.setState({value: event.target.value}); + } + + submit(event) { + console.log("This", this.state.value); + } + + render() { + return (
+ + +
); + } +} + const main = (

Schala web input

Write your source code here

+
); const rootDom = document.getElementById("main"); -ReactDOM.render(

Schala web input

, rootDom); +ReactDOM.render(main, rootDom);