Skip to content

Codemod can mark a root clean while it mounts an unchanged React hook component #2599

Closed

Description

@domgan-oai

Reproduction

Run the React-to-Octane codemod in Strong mode with verification and project types. Select only App.tsx.

// App.tsx
import * as ReactDOM from 'react-dom/client';
import { ReactLeaf } from './leaf';

export function mount(container: HTMLElement, label: string) {
  const root = ReactDOM.createRoot(container);
  root.render(<ReactLeaf label={label} />);
  return () => root.unmount();
}

export function Native() {
  return <b>native</b>;
}
// leaf.ts, outside the selected inputs
import { createElement, useState } from 'react';

export function ReactLeaf(props: { label: string }) {
  const [label] = useState(props.label);
  return createElement('i', null, label);
}

Actual behavior

The tool rewrites the root and its direct render call to Octane and reports Strong with zero findings. The imported leaf still calls React's useState. The original React root mounts the leaf. The migrated root throws because no React dispatcher owns the render.

Expected behavior

Report the renderer ownership mismatch when a direct rewritten root render reaches an unchanged local export whose original React hook call is provable. A selected leaf that migrates with the root and a leaf already owned by Octane should still convert normally.

Codex task · Host com-79386

Activity

  1. added
    bug
    agent-authored
    on Nov 13, 2026
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

    agent-authoredbug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions