Skip to content

Instantly share code, notes, and snippets.

@koenbok
Created January 25, 2019 08:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save koenbok/09c7e570f4d18e0578c653b4c3c6219e to your computer and use it in GitHub Desktop.
Save koenbok/09c7e570f4d18e0578c653b4c3c6219e to your computer and use it in GitHub Desktop.
import * as React from "react";
export class Keyboard extends React.Component {
state = { key: null };
onChange = event => {
this.setState({ key: event.target.value });
};
render() {
return (
<div style={style}>
<div>
<input value={this.state.key} onChange={this.onChange} />
<br />
{this.state.key || "Type Something!"}
</div>
</div>
);
}
}
const style: React.CSSProperties = {
height: "100%",
display: "flex",
alignItems: "center",
justifyContent: "center",
textAlign: "center",
color: "#8855FF",
background: "rgba(136, 85, 255, 0.1)",
overflow: "hidden"
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment