@WebStormIDE For some reason, in the latest version of OSX WS (2019.1.3), I have lost my React intention that allows me to convert class components to functional components. I don't see it in the Refactor menu, I don't see it in the lightbulb menu. Not with Ctrl+T or Alt+Enter.
-
Show this thread
-
@WebStormIDE as you can see, in both menus, there's nothing to do with Component.pic.twitter.com/khqFqL2kBB
1 reply 0 retweets 0 likesShow this thread -
Replying to @stevensacks
Does it happen just for this component or all of them? If it doesn’t work only for this one, could you please create an issue with a code sample? If it’s all of them - please check if Preferences | Intentions | Convert to class/functional component are enabled
1 reply 0 retweets 0 likes -
Replying to @WebStormIDE
Any and all. And I just discovered something. It only doesn't show up for converting class component to functional. Functional components show "Convert to class component".pic.twitter.com/AIyRVcwy0t
1 reply 0 retweets 1 like -
Replying to @stevensacks
Does it happen in a new project? If it does, please send it to us as a sample
1 reply 0 retweets 1 like -
Replying to @WebStormIDE
It happens in each and every React project I have. I can convert from functional to class, but not the other way.
1 reply 0 retweets 0 likes -
Replying to @stevensacks
Can you please check if it works for something as simple as: https://gist.github.com/prigara/33b120d5a8fc9498c6e5065fc826836c … In general, this action is available only when the component doesn't reference the state and doesn't have any members other than render, propTypes, or defaultProps. Thanks!
2 replies 0 retweets 0 likes -
Replying to @WebStormIDE
Ok, I’ve discovered the following. If I put the caret within the name of the component, convert to class component is there. If I put the caret within the keyword “class”, convert to functional component shows up. I expected it to show up within the component name. Is that a bug?
1 reply 0 retweets 1 like -
Replying to @stevensacks
Sounds like a bug, but we still can't reproduce it neither with a simple nor with a more complex component
(on the screenshot the cursor is inside `Welcome`)pic.twitter.com/OmES1F8fdU
1 reply 0 retweets 1 like -
Replying to @WebStormIDE
It’s convert from class to functional that is a problem for me with the caret in the name of the component vs inside of the word “class”.
1 reply 0 retweets 0 likes
Sorry, wrong screenshot, but it still works fine for us :( We are testing it in WebStorm 2019.1.3.
-
-
Replying to @WebStormIDE
Yeah not for me.
I can only convert from class to functional if the caret is inside of the word “class”. I can go the other way anytime.1 reply 0 retweets 0 likes -
- 2 more replies
New conversation -
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.