我有一个组件,如下所示:
const App = (): ReactElement => {
const submitFeedbackHandler = (e: FormEvent): void => {
e.preventDefault();
// ...
}
return <>
<form onSubmit={submitFeedbackHandler}>
// ...
<button type='submit'>Submit</button>
</form>
</>
}
问题是,无论我如何尝试从中调用它都不起作用。我试过了,但也没有运气。我怎样才能让它工作,这样我才能做到?submitFeedbackHandleronSubmitonSubmit={(e) => submitFeedbackHandler(e)}e.preventDefault()
慕慕森
相关分类