1- Oh shoot! I updated the gist... Thanks a lot!
2- That's true, it wouldn't persist, but you might want to use it only once. Like a flag variable.
Also, I try to reduce my usage of useRef because it has it is cost on memory, only if something is important, I would use useRef.