Skip to content

fix: ShootingHUD performance.now() impure function in useRef #2

Description

@wpinrui

ESLint react-hooks/purity error in src/screens/ShootingHUD/index.tsx:121

const t0Ref = useRef(performance.now())

performance.now() is impure — calling it during render produces unstable results. Should be initialised inside a useEffect or lazily via a ref.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions