Commit 00d7ca6
authored
Fix: Explicitly Initialize Input Refs with null for Better Type Safety (#31)
### Summary
This PR updates the initialization of `ref<HTMLInputElement>` references by explicitly setting them to `null`.
### Changes
- Updated `ref<HTMLInputElement>()` to `ref<HTMLInputElement | null>(null)`, ensuring proper type safety.
- Prevents potential runtime errors by making sure `passwordInput.value` and `currentPasswordInput.value` are never `undefined`.
- Aligns with Vue best practices for handling template refs.
### Why?
- Without explicit `null`, TypeScript infers `undefined`, leading to potential issues when accessing `.value`.
- Ensures better predictability and avoids unnecessary runtime checks.
This change improves overall code reliability and maintainability.1 parent 254fc9c commit 00d7ca6
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
| 28 | + | |
| 29 | + | |
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
| |||
0 commit comments