Files
klz-cables.com/.pnpm-store/v10/files/bd/1f9fabdf62eeeca4e1c2d21c5099e5840a6bd0f541e6b97a54af61e202cb6576d7d80d35cb10e0451b9ffbc01c78cd60c4a76f7b7b45dfe5a27f419878a735
Marc Mintel 5397309103
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled
fix(products): fix breadcrumbs and product filtering (backport from main)
2026-02-24 16:04:21 +01:00

39 lines
876 B
Plaintext

'use client';
import { c as _c } from "react/compiler-runtime";
import { useEffect, useRef, useState } from 'react';
export function useControllableState(propValue, fallbackValue) {
const $ = _c(5);
const [localValue, setLocalValue] = useState(propValue);
const initialRenderRef = useRef(true);
let t0;
let t1;
if ($[0] !== propValue) {
t0 = () => {
if (initialRenderRef.current) {
initialRenderRef.current = false;
return;
}
setLocalValue(propValue);
};
t1 = [propValue];
$[0] = propValue;
$[1] = t0;
$[2] = t1;
} else {
t0 = $[1];
t1 = $[2];
}
useEffect(t0, t1);
const t2 = localValue ?? fallbackValue;
let t3;
if ($[3] !== t2) {
t3 = [t2, setLocalValue];
$[3] = t2;
$[4] = t3;
} else {
t3 = $[4];
}
return t3;
}
//# sourceMappingURL=useControllableState.js.map