useState is not working

can anyone tell me why in given below code is not working properly
 const [localStorageTheme, setLocalStorageTheme] = useState(() => {
    const lTheme = localStorage.getItem("localStorageTheme");
    if (lTheme) {
      return lTheme;
    }
    const isLight = window.matchMedia("(prefers-color-scheme: light)").matches;
    console.log(isLight);
    return isLight ? "light" : "dark";
  });

let it return us "dark" but now i am trying to change dom by this value it is not working
{
    <div
        style={{
          transitionTimingFunction: "steps(10)",
        }}
        className={`leading-none w-[660px] h-[100%]  block overflow-hidden transition-transform ${
          localStorageTheme === "dark" ? "translate-x-[-93%] " : "translate-x-0"
        } duration-100`}
      >
          //code
      </div>
}

in dom it is putting value of "translate-x-0" it should be "translate-x-[-93]"
Was this page helpful?