Update input.md (#7418)

* Update input.md

Fix typo about input

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

---------

Co-authored-by: Ricky <rickhanlonii@gmail.com>
This commit is contained in:
Pier-Luc Caron St-Pierre
2025-02-18 00:50:24 -05:00
committed by GitHub
parent 126d8c9aa5
commit 55d1f8fab6

View File

@@ -297,7 +297,7 @@ Give a `name` to every `<input>`, for example `<input name="firstName" defaultVa
<Pitfall>
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 [`<button 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.
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.
</Pitfall>