{"version":3,"file":"use-is-first-render.cjs","names":[],"sources":["../../src/hooks/use-is-first-render.ts"],"sourcesContent":["/* eslint-disable react-hooks/refs -- flipping the flag during render IS this hook */\nimport { useRef } from \"react\";\n\n/**\n * Return `true` on the first render of the component and `false` thereafter.\n *\n * Reads *and* flips a ref during render, which the React Compiler rules flag on\n * sight — here it is the entire hook. Under StrictMode's double render in dev the\n * second pass already sees `false`, so treat the result as \"first committed\n * render\" and not as a strict render counter.\n *\n * @returns Whether the current render is the first one.\n */\nexport function useIsFirstRender(): boolean {\n    const isFirst = useRef<boolean>(true);\n    if (isFirst.current) {\n        isFirst.current = false;\n        return true;\n    }\n    return false;\n}\n"],"mappings":"uBAaA,SAAgB,GAA4B,CACxC,IAAM,GAAA,EAAU,EAAA,OAAA,CAAgB,EAAI,EAKpC,OAJI,EAAQ,SACR,EAAQ,QAAU,GACX,IAEJ,EACX"}