function Comp () {
        const [counter, setCounter] = useState(0)

        useLayoutEffect(() => {
          if (counter === 0) setCounter(1)