DEV Community

Discussion on: Using Javascript Sets with React useState

Collapse
 
ledu6 profile image
Benoit LEGER-DERVILLE

Thanks for this post and the David K. tweet ... now as I really want to use a Set for filtering long log entries, I'm wondering if the correct way isn't to use a Set in the useRef box, with eventually a useEffect kind of reset ?

What do you think ?

Collapse
 
ganes1410 profile image
Ganesh R

Hi, I used Set values to render some UI. So I used it as state. I think we can also use it as an ref too. But I have not tried that.