fix: pass undefined to useRef for strict TypeScript compat

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
lucaronin
2026-03-05 14:40:05 +01:00
parent a364cbc2bd
commit 239ff7fd97

View File

@@ -30,7 +30,7 @@ function NumberInput({ property, value, onChange }: {
onChange: (val: string) => void
}) {
const numericValue = typeof value === 'number' ? value : parseFloat(String(value)) || 0
const debounceRef = useRef<ReturnType<typeof setTimeout>>()
const debounceRef = useRef<ReturnType<typeof setTimeout>>(undefined)
const handleChange = useCallback((e: React.ChangeEvent<HTMLInputElement>) => {
const raw = e.target.value
@@ -68,7 +68,7 @@ function ColorInput({ property, value, onChange }: {
onChange: (val: string) => void
}) {
const [localValue, setLocalValue] = useState(value)
const debounceRef = useRef<ReturnType<typeof setTimeout>>()
const debounceRef = useRef<ReturnType<typeof setTimeout>>(undefined)
const showSwatch = isValidCssColor(localValue)
const handleTextChange = useCallback((e: React.ChangeEvent<HTMLInputElement>) => {
@@ -121,7 +121,7 @@ function TextInput({ property, value, onChange }: {
value: string
onChange: (val: string) => void
}) {
const debounceRef = useRef<ReturnType<typeof setTimeout>>()
const debounceRef = useRef<ReturnType<typeof setTimeout>>(undefined)
const handleChange = useCallback((e: React.ChangeEvent<HTMLInputElement>) => {
const newVal = e.target.value