import{useState as f,useEffect as g}from"react";const i=({isSelected:e,onChange:c,defaultSelected:n=!1})=>{const[u,o]=f(n),t=e!==void 0,l=t?e:u,s=d=>{t||o(d),c&&c(d)},S=()=>s(!l);return g(()=>{t&&o(e)},[e]),{isSelected:l,setSelected:s,toggle:S}};export{i as useToggleState};
//# sourceMappingURL=useToggleState.js.map
