Last_Dance
This commit is contained in:
15
ubung4_zahlen_PC/lab07/src/useIsPriceToHigh.jsx
Normal file
15
ubung4_zahlen_PC/lab07/src/useIsPriceToHigh.jsx
Normal file
@ -0,0 +1,15 @@
|
||||
import { useState, useEffect } from "react";
|
||||
import { useSelector } from "react-redux";
|
||||
|
||||
export function useIsPriceToHigh(priceBorder) {
|
||||
const currentConfigCost = useSelector((state) => state.cost);
|
||||
const [isPriceToHigh, setIsPriceToHigh] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
// null;
|
||||
setIsPriceToHigh(currentConfigCost > priceBorder);
|
||||
|
||||
}, [currentConfigCost, priceBorder]);
|
||||
|
||||
return [isPriceToHigh];
|
||||
}
|
Reference in New Issue
Block a user