Skip to content

Bug: useEffect does not run twice due to remounting in strict mode and dev run #35017

Closed as not planned

Description

@TaiseiYokoshima

useEffect does not run twice in strict mode and dev run due to the remount semantic.

React version: 19.1.1

function DebugMount() {
  useEffect(() => {
    console.log('[DebugMount] mounted');
    return () => console.log('[DebugMount] cleanup');
  }, []);
  return null;
}


function App() {
   return <DebugMount/>;
}

createRoot(document.getElementById('root')!).render(
   <StrictMode>
      <App/>
   </StrictMode>
);

The current behavior

useEffect does not run twice on with remount behavior in strict mode and dev run.

The expected behavior

it should run twice

Activity

  1. added
    Status: Unconfirmed
    on Oct 30, 2025
  2. ish1416 commented on Nov 5, 2025

    @ish1416

    Hi, I’m Ishita. I’d like to work on this issue and investigate why useEffect is not running twice in Strict Mode under React 19.1.1, despite the expected remount behavior.
    Could you please assign this issue to me?
    Thanks!

  3. shubhanshu2103 commented on Nov 9, 2025

    @shubhanshu2103

    The current behavior deviates from the documented Strict Mode remounting semantics since React 18.

    Expected output (React 18+ Strict Mode dev): [DebugMount] mounted [DebugMount] cleanup [DebugMount] mounted

    The report states useEffect is not running twice (i.e., only a single mount-like lifecycle is observed). This suggests a regression in the development-only mount/unmount/remount logic for effects.

    I am confirming the bug and requesting it be assigned for investigation into the Strict Mode component tree remount logic in the specified version (19.1.1).

  4. github-actions commented on Feb 7, 2026

    @github-actions

    This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment!

  5. added
    Resolution: Stale
    on Feb 7, 2026
  6. github-actions commented on Feb 14, 2026

    @github-actions

    Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Resolution: StaleStatus: Unconfirmed

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions