refactoring JS, move function to different file, etc.?
Refactoring for Java was really good in IntelliJ. But refactoring for JS is lacking. I swear there was a "move member" or something similar, so I can move a function to a different file. But I can't find it now. Was it taken out or does it not work in some cases?
Are there any plugins that can help? I was wondering specifically for React as well as vanilla JS. For example, it would be awesome to extract a component, or to convert between React class and functional components!
Thanks.
Please sign in to leave a comment.
>I swear there was a "move member" or something similar, so I can move a function to a different file.
Moving class methods is not supported, https://youtrack.jetbrains.com/issue/WEB-34698
You can, however, move top-level functions using Move refactoring - see https://www.jetbrains.com/help/webstorm/specific-javascript-refactorings.html#javascript_move_refactorings
>extract a component
it's supported, https://www.jetbrains.com/help/webstorm/react.html#extract_component
>convert between React class and functional components
Available through Alt+Enter