react object events and what to link with
During my personal site revamp I started learning React and noticed that I had
some errors when I was trying to assign a link to a <div>
. These were
both the linting and functional errors regarding what we "should" do to elements.
After reading up I found a few StackOverflow posts that correctly describe the behavior we should have.
Posts:
Loose rendition of the code I was using:
<div
onClick={event => (navigate(/posts))}
>
Errors I received:
> Visible, non-interactive elements with click handlers must have at least one keyboard listener.
> Static HTML elements with event handlers require a role.