Last active
August 30, 2022 10:39
-
-
Save luismartinezs/422e7d2c424d8f65a4923e662a788b79 to your computer and use it in GitHub Desktop.
A11y React components #a11y #react
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// https://reactjs.org/docs/accessibility.html | |
import React from 'react'; | |
function ListItem({ item }) { | |
return ( | |
// https://reactjs.org/docs/fragments.html | |
<> | |
<dt>{item.term}</dt> | |
<dd>{item.description}</dd> | |
</> | |
); | |
} | |
function Glossary(props) { | |
return ( | |
<dl> | |
{props.items.map(item => ( | |
<ListItem item={item} key={item.id} /> | |
))} | |
</dl> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment