TIL @intellijidea/@WebStormIDE automatically converts React class components to functional and vice-versa.
Not sure which version added it, but I've been doing this manually since ever and this is great!
Now it would be fantastic if it preserved imports order and comments.
pic.twitter.com/NiA1Pf5g56
-
-
Replying to @tsbnunes @intellijidea
Hello Tiago, you can disable sorting of imported members in Preferences | Editor | Code Style | JavaScript - Imports.
1 reply 0 retweets 3 likes -
Replying to @WebStormIDE @intellijidea
Tried that and it didn't affect this specific refactor. Different code path or maybe a bug?
1 reply 0 retweets 0 likes -
Replying to @tsbnunes @intellijidea
Sorry, can only reproduce that when Sort imports by module and Sort imported members are checked in the code style settings.
1 reply 0 retweets 0 likes -
Replying to @WebStormIDE @intellijidea
Disabling both did indeed prevent it, was previously only disabling the first. Thanks! Only remaining issue is comments being stripped when converting to class. It doesn't happen when converting to functional. Should I raise a bug for this one?
1 reply 0 retweets 0 likes -
Replying to @tsbnunes @intellijidea
Great!
Please report an issue on our tracker: https://youtrack.jetbrains.com/issues/WEB Code sample would help a lot.1 reply 0 retweets 0 likes -
Replying to @WebStormIDE @intellijidea
There you go!
https://youtrack.jetbrains.com/issue/IDEA-202992 …1 reply 0 retweets 0 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.