useRef<T> method
Create a ref hook
Implementation
RefObject<T> useRef<T>([T? initialValue]) {
if (_hookIndex >= _hooks.length) {
// Create new hook
final hook = RefHook<T>(initialValue);
_hooks.add(hook);
}
// Get the hook (either existing or newly created)
final hook = _hooks[_hookIndex] as RefHook<T>;
_hookIndex++;
return hook.ref;
}