Skip to content

Commit c6e906b

Browse files
authored
Update src/content/reference/react-dom/components/input.md
1 parent a5147c6 commit c6e906b

File tree

1 file changed

+1
-1
lines changed
  • src/content/reference/react-dom/components

1 file changed

+1
-1
lines changed

src/content/reference/react-dom/components/input.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@ Give a `name` to every `<input>`, for example `<input name="firstName" defaultVa
297297

298298
<Pitfall>
299299

300-
By default, *any* `<button>` inside a `<form>` will submit it. This can be surprising! If you have your own custom `Button` React component, consider returning [`<input type="button">`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/button) instead of `<button>`. Then, to be explicit, use `<button type="submit">` for buttons that *are* supposed to submit the form.
300+
By default, a `<button>` inside a `<form>` without a `type` attribute will submit it. This can be surprising! If you have your own custom `Button` React component, consider using [`<button type="button">`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/button) instead of `<button>` (with no type). Then, to be explicit, use `<button type="submit">` for buttons that *are* supposed to submit the form.
301301

302302
</Pitfall>
303303

0 commit comments

Comments
 (0)