It looks like your component is wrapped in StrictMode component:
Strict Mode enables the following development-only behaviors:
Your components will re-render an extra time to find bugs caused by impure rendering.
Your components will re-run Effects an extra time to find bugs caused by missing Effect cleanup.
Your components will re-run refs callbacks an extra time to find bugs caused by missing ref cleanup.
Your components will be checked for usage of deprecated APIs.