React useState vs useRef: How I Fixed an Extra Render Bug While Tracking Component Mount
I recently faced an issue using React useState to track component mount that caused an extra re-render. Here's why useRef is a better choice, how it prevents unnecessary renders, and when to use each