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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user