下面的代码将导致2次提交。如果我在表单上添加onSubmit = {e => {e.preventDefault();}},则将有零个提交:
export default function SearchBar() {
return (
<div>
<form
action={BackEnd_ServerName + "/xyz"}
method="GET"
>
<input
type="text"
placeholder=""
name="frontEnd_searchBox"
/>
</form>
</div>
);
}
export default function SearchBar() {
return (
<div>
<form>
<input
type="text"
placeholder=""
name="frontEnd_searchBox"
/>
</form>
</div>
);
}