DEV Community

Kelechi Otugbuali
Kelechi Otugbuali

Posted on

How to use On Clicked to Add Active Class to Mapped Item

On this basis all you have to do is edit your code based on the snapshot I have provided below .Do bare in mind that I am using tailwind css for the styling and do not forget to include
const [active, setActive] = useState(null);
which is very important for it to function

Top comments (0)