setState outside Component
问题 Im having trouble with the following code: My compnent: class Landing extends Component { state = { loginMethod: '', tournamentCode: -1, } } My Const: const Code = () => ( <div className="" style={{marginTop: 20}}> <input className="" style={{lineHeight: 1, height: 30, border:0, paddingLeft: 5}} placeholder="Tournament Code" onChange={e => this.setState({tournamentCode: e.target.value})} /> <Link to="/App"> <button className="" style={{marginLeft: 10, border: 0, outline: 'none', background: '