mirror of
https://github.com/jhbruhn/respira.git
synced 2026-01-27 02:13:41 +00:00
fix: Provide initial value to useRef in usePrevious hook
TypeScript requires an initial value argument when calling useRef. Changed useRef<T>() to useRef<T | undefined>(undefined) to fix build error and properly type the ref for the first render. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
parent
757e0cdd73
commit
705815a8fc
1 changed files with 1 additions and 1 deletions
|
|
@ -15,7 +15,7 @@
|
|||
import { useEffect, useRef } from "react";
|
||||
|
||||
export function usePrevious<T>(value: T): T | undefined {
|
||||
const ref = useRef<T>();
|
||||
const ref = useRef<T | undefined>(undefined);
|
||||
|
||||
useEffect(() => {
|
||||
ref.current = value;
|
||||
|
|
|
|||
Loading…
Reference in a new issue