DEV Community

Discussion on: Introduction to useRef Hook

Collapse
 
yael95 profile image
Yahya Elfaqir

What if for instance I have multiple buttons and I want to add a component when a particular button is clicked, eg sorting by title, author ..., each of these have a sort button and I want to show an up or down arrow next to each ACTIVE one not all of them, how can I use useRef to achieve that?