-
Notifications
You must be signed in to change notification settings - Fork 12.8k
Cannot Move React Class Component To New File #59747
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Labels
Bug
A bug in TypeScript
Domain: Refactorings
e.g. extract to constant or function, rename symbol
Effort: Moderate
Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".
Help Wanted
You can do this
Milestone
Comments
Any fixes yet? |
I get this quite frequently (also in non tsx code files). Because we moved to relative file imports, it is quite important that this feature works reliably, as manual "move to file" is very involved. FYI @alexdima
|
This was referenced Oct 22, 2024
If it can help, I'm able to reproduce that issue on a simple scenari as well: test1.ts: import Test from './test2.js'
export function test(test: Test): void {
console.log(test)
} test2.ts: enum Test {
Value = 0
}
namespace Test {
export const value = Test.Value
}
export default Test then tries to "move to new file" the test function from test1.ts |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Bug
A bug in TypeScript
Domain: Refactorings
e.g. extract to constant or function, rename symbol
Effort: Moderate
Requires experience with the TypeScript codebase, but feasible. Harder than "Effort: Casual".
Help Wanted
You can do this
Uh oh!
There was an error while loading. Please reload this page.
🔎 Search Terms
After invoking the code action "Move To A New File" on a react class component, this error is printed to the dev console:
🕗 Version & Regression Information
Probably reproducible in newer and older versions within that range.
⏯ Playground Link
No response
💻 Code
🙁 Actual behavior
The refactoring does not do anything.
🙂 Expected behavior
The refactoring should work.
Additional information about the issue
No response
The text was updated successfully, but these errors were encountered: