You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: react/README.md
+15-3Lines changed: 15 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -249,15 +249,27 @@
249
249
250
250
```javascript
251
251
// bad - not an ARIA role
252
-
<div role="datepicker"></div>
252
+
<div role="datepicker" />
253
253
254
254
// bad - abstract ARIA role
255
-
<div role="range"></div>
255
+
<div role="range" />
256
256
257
257
// good
258
-
<div role="button"></div>
258
+
<div role="button" />
259
259
```
260
260
261
+
- Do not use `accessKey` on elements. eslint: [`jsx-a11y/no-access-key`](https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/no-access-key.md)
262
+
263
+
> Why? Inconsistencies between keyboard shortcuts and keyboard commands used by people using screenreaders and keyboards complicate accessibility.
264
+
265
+
```javascript
266
+
// bad
267
+
<div accessKey="h" />
268
+
269
+
// good
270
+
<div />
271
+
```
272
+
261
273
## Parentheses
262
274
263
275
- Wrap JSX tags in parentheses when they span more than one line. eslint: [`react/wrap-multilines`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/wrap-multilines.md)
0 commit comments