mirror of
https://github.com/reactjs/react.dev.git
synced 2026-02-23 04:12:34 +00:00
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:
committed by
GitHub
parent
126d8c9aa5
commit
55d1f8fab6
@@ -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>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user