Skip to content

Commit b1d85b7

Browse files
committed
chore(docs): regenerate heading ids for JSX attributes section
1 parent f39d383 commit b1d85b7

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

src/content/learn/writing-markup-with-jsx.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ For historical reasons, [`aria-*`](https://developer.mozilla.org/docs/Web/Access
228228
229229
JSX looks a lot like HTML, but a few attributes work slightly differently because JSX maps to JavaScript and DOM properties. This short reference explains the common differences and shows examples you can copy.
230230
231-
### Attribute name differences
231+
### Attribute name differences {/*attribute-name-differences*/}
232232
233233
Some HTML attribute names are either reserved words in JavaScript or differ from the DOM property names. Use the React/JSX name when writing JSX:
234234
@@ -240,7 +240,7 @@ Some HTML attribute names are either reserved words in JavaScript or differ from
240240
<label htmlFor="email">Email</label>
241241
```
242242
243-
### Boolean attributes
243+
### Boolean attributes {/*boolean-attributes*/}
244244
245245
In HTML, boolean attributes are represented by their presence. In JSX, you pass explicit boolean values—but JSX also supports the shorthand form (which means `true`):
246246
@@ -256,7 +256,7 @@ In HTML, boolean attributes are represented by their presence. In JSX, you pass
256256
<input disabled />
257257
```
258258
259-
### Inline styles
259+
### Inline styles {/*inline-styles*/}
260260
261261
HTML uses a CSS string. JSX uses a JavaScript object with camelCased property names:
262262
```html
@@ -272,7 +272,7 @@ Numeric values (like lineHeight, zIndex) can be written as numbers
272272
<div style={{ lineHeight: 1.5, zIndex: 10 }} />
273273
```
274274
275-
### Data and ARIA attributes
275+
### Data and ARIA attributes {/*data-and-aria-attributes*/}
276276
277277
React preserves data-* and aria-* attributes exactly as they appear in HTML. These must remain dash-cased:
278278
```jsx
@@ -284,7 +284,7 @@ React preserves data-* and aria-* attributes exactly as they appear in HTML. The
284284
```
285285
These attributes are ideal for accessibility and for storing custom data.
286286
287-
### Unknown or invalid attributes
287+
### Unknown or invalid attributes {/*unknown-or-invalid-attributes*/}
288288
289289
React will not add invalid or unknown attributes to the DOM:
290290
```jsx
@@ -305,7 +305,7 @@ function Button({ children, ...rest }) {
305305
<Button data-track="1" disabled>Click</Button>
306306
```
307307
308-
### Tips & common gotchas
308+
### Tips & common gotchas {/*tips--common-gotchas*/}
309309
310310
- Use DOM property names (`className`, `htmlFor`, `defaultValue`) in JSX.
311311
- Boolean attributes should use `true` or `false`, not strings.

0 commit comments

Comments
 (0)