Skip to content

Codemod misses React useCallback in unchanged local hooks #2606

Closed

Description

@domgan-oai

Reproduction

In a project using the automatic React JSX runtime, migrate only Label.tsx with Strong mode, project types and compiler verification enabled. Leave the local TypeScript helper in place.

use-label.ts

import { useCallback as retain } from 'react';

export function useLabel(value: string) {
	const read = retain(() => value, [value]);
	return read();
}

Label.tsx

import { useLabel } from './use-label';

export function Label() {
	const value = useLabel('ready');
	return <b>{value}</b>;
}

The codemod reports the selected component as Strong with no findings. React SSR renders it. The emitted native Octane component still calls the unchanged hook, and production Octane SSR throws when the React package attempts to read useCallback from its dispatcher.

Expected behavior

Report the retained React hook at a proven native setup call, using the same ownership proof as the existing retained-hook diagnostics. Keep the helper unchanged. A local alias of the named React import still calls the React dispatcher.

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