@Alex-Archer-I
Posted
Hi!
No, the css hover effect is quite enough for this case. useState
would be an overkill and an extra load on the app. But it's good that you're looking for various ways of implementation.
And a couple of semantic suggestions. This is a list of links, so it's better to use ul
and li
tags here.
<ul>
<li><a href="#">It's a link here.</a></li>
...more links here
</ul>
If you are changing the display
property of the ul
or ol
tags, you also need to add role="list"
attribute to it.
Also every page should contain main
tag. For example you can use as root
for app building.
Hope that could help. Good luck =)
Marked as helpful
@justinsane
Posted
@Alex-Archer-I Great suggestions. Thanks for making me aware of role="list"
. I refactored my code. See below.
@Alex-Archer-I
Posted
@justinsane
Yes, that's right =)
I want to warn you though about key
values. It should be unique values which will definitely not change. Of course it is important mostly for the components which state could be changed, so it isn't a thing for this project, but it's good to keep that in mind.
In real projects you'll often be work with data from the database, where every object has its own id. And sometimes you can't fully predict which part of the data could change, but it totally won't be an id. So it's a good habit (especially since you are already simulate array of data and you can add everything to it) to use id as key value.
Sorry, if you are already aware about it, it's hard to tell who at what level here.
Marked as helpful
@justinsane
Posted
@Alex-Archer-I good to know about key
values, thanks!