MCPcopy
hub / github.com/kenberkeley/react-demo / handleSubmit

Method handleSubmit

src/components/Navbar/LoginForm.js:15–19  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

13 }
14
15 handleSubmit () {
16 let username = this.state.username
17 if (!username) return alert('用户名为空')
18 this.props.login({ username })
19 }
20
21 render () {
22 /* 由于 ES6 中 React 不会自动绑定this,直接 onSubmit={this.handleSubmit} 会报错

Callers

nothing calls this directly

Calls 1

loginMethod · 0.80

Tested by

no test coverage detected