您应该在类MyComponent下使用构造函数扩展React.Component
constructor(props){ super(props); this.onSubmit = this.onSubmit.bind(this); }然后您将获得标题的结果

您应该在类MyComponent下使用构造函数扩展React.Component
constructor(props){ super(props); this.onSubmit = this.onSubmit.bind(this); }然后您将获得标题的结果