Visually, this looks great! Just a word of advice, you'll want to use anchors for the tabs rather than just list items. You can nest an a inside each list item and style it accordingly. This allows for keyboard navigation, as well as use of attributes like aria-current="page" to designate the active page. It also means you no longer need an onClick handler and can just use an href. (Note that most client-side routing libraries will also expose a custom Link component, so you could use one of those instead.)
Yes I would do just that, but unfortunately I didn't have the react-router installed in my project. 🤓 But anyway thanks for your comment, it's informative and complements the article! 😊
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Visually, this looks great! Just a word of advice, you'll want to use anchors for the tabs rather than just list items. You can nest an
a
inside each list item and style it accordingly. This allows for keyboard navigation, as well as use of attributes likearia-current="page"
to designate the active page. It also means you no longer need anonClick
handler and can just use anhref
. (Note that most client-side routing libraries will also expose a customLink
component, so you could use one of those instead.)Yes I would do just that, but unfortunately I didn't have the react-router installed in my project. 🤓 But anyway thanks for your comment, it's informative and complements the article! 😊