Skip to content

Commit c020bcd

Browse files
committed
docs: minor improvements
1 parent 01a86a2 commit c020bcd

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

website/pages/docs/rules/dom-no-missing-button-type.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,11 @@ react-dom/no-missing-button-type
3131

3232
## What it does
3333

34-
Enforces explicit `type` attribute for `<button>` elements.
34+
Enforces explicit `type` attribute for `button` elements.
3535

36-
The `type` attribute of the `button` element needs to be specified. The default value is `type="submit"`, which can easily lead to unexpected behavior, especially when used in a form.
36+
The default `type` of a button is `submit`, which causes the submission of a form when placed inside a `form` element. This is likely not the behaviour that you want inside a React application.
37+
38+
Allowed button types are: `submit`, `button` or `reset`.
3739

3840
## Examples
3941

website/pages/docs/rules/overview.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@
8383
| [`no-dangerously-set-innerhtml-with-children`](dom-no-dangerously-set-innerhtml-with-children) | 2️⃣ | `🔍` | Prevents `DOM element` using `dangerouslySetInnerHTML` and `children` at the same time. |
8484
| [`no-dangerously-set-innerhtml`](dom-no-dangerously-set-innerhtml) | 1️⃣ | `🔍` | Prevents `DOM element` using `dangerouslySetInnerHTML`. |
8585
| [`no-find-dom-node`](dom-no-find-dom-node) | 2️⃣ | `🔍` | Prevents using `findDOMNode`. |
86-
| [`no-missing-button-type`](dom-no-missing-button-type) | 1️⃣ | `🔍` | Enforces explicit `type` attribute for `<button>` elements. |
86+
| [`no-missing-button-type`](dom-no-missing-button-type) | 1️⃣ | `🔍` | Enforces explicit `type` attribute for `button` elements. |
8787
| [`no-missing-iframe-sandbox`](dom-no-missing-iframe-sandbox) | 1️⃣ | `🔍` | Enforces explicit `sandbox` attribute for `iframe` elements. |
8888
| [`no-namespace`](dom-no-namespace) | 2️⃣ | `🔍` | Enforces the absence of a `namespace` in React elements. |
8989
| [`no-render-return-value`](dom-no-render-return-value) | 2️⃣ | `🔍` | Prevents using the return value of `ReactDOM.render`. |

0 commit comments

Comments
 (0)