fix: Typfehler in useLoopDisplay und Kue705FO behoben, Build erfolgreich

- useLoopDisplay.ts angepasst: useState nun explizit als `number` deklariert
- Typensicherheit in Kue705FO.tsx verbessert:
  - `schleifenwiderstand` wird immer als `number` konvertiert
  - `setLoopDisplayValue` akzeptiert nur `number`
- Fehlerhafte Typzuweisung in `handleButtonClick` korrigiert
- `npm run build` läuft nun ohne Fehler

 Code nun sauber typisiert, keine TypeScript-Fehler mehr 🚀
This commit is contained in:
ISA
2025-02-24 14:52:51 +01:00
parent 91103b28ec
commit f8e76b52a6
3 changed files with 20 additions and 6 deletions

View File

@@ -5,7 +5,8 @@ const useLoopDisplay = (
schleifenwiderstand: number,
activeButton: "Schleife" | "TDR"
) => {
const [loopDisplayValue, setLoopDisplayValue] = useState(schleifenwiderstand);
const [loopDisplayValue, setLoopDisplayValue] =
useState<number>(schleifenwiderstand);
useEffect(() => {
if (activeButton === "Schleife") {
@@ -13,7 +14,7 @@ const useLoopDisplay = (
}
}, [schleifenwiderstand, activeButton]);
return loopDisplayValue;
return { loopDisplayValue, setLoopDisplayValue };
};
export default useLoopDisplay;