Skip to content

Commit

Permalink
🔧 edit tsconfig.json and change txs
Browse files Browse the repository at this point in the history
  • Loading branch information
ymyqwe committed Nov 4, 2019
1 parent aef82e0 commit 608ecc7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
11 changes: 6 additions & 5 deletions src/components/ChatInput.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import * as React, { Component } from 'react';
import React, { Component } from 'react';

export default class ChatInput extends Component {
type MyProps = { socket: any };
type MyState = { socket: any; message: string; myId: string; myName: string };
export default class ChatInput extends Component<MyProps, MyState> {
constructor(props) {
super(props);
this.state = {
Expand All @@ -17,7 +19,7 @@ export default class ChatInput extends Component {
}

// 点击提交或按回车

handleClick(e) {
e.preventDefault();
this.sendMessage();
Expand Down Expand Up @@ -49,7 +51,7 @@ export default class ChatInput extends Component {
<div className="bottom-area">
<div className="input-box">
<div className="input">
<input type="text" maxLength="140" placeholder="按回车提交" value={this.state.message} onKeyPress={this.handleKeyPress.bind(this)} onChange={this.handleChange.bind(this)} />
<input type="text" maxLength={140} placeholder="按回车提交" value={this.state.message} onKeyPress={this.handleKeyPress.bind(this)} onChange={this.handleChange.bind(this)} />
</div>
<div className="button">
<button type="button" onClick={this.handleClick.bind(this)}>
Expand All @@ -58,7 +60,6 @@ export default class ChatInput extends Component {
</div>
</div>
</div>

);
}
}
1 change: 1 addition & 0 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"sourceMap": true,
"allowJs": true,
"module": "commonjs",
"esModuleInterop": true,
"jsx": "react",
"target": "es5"
},
Expand Down

0 comments on commit 608ecc7

Please sign in to comment.