Ok @WebStormIDE , how do you get the “Convert to Functional Component” to work? No matter what I select, it stays greyed out
-
-
Replying to @toddcochran
Can you please show how your component looks like? Only class components that don't reference `state` and don't have any members other than `render`, `propTypes`, or `defaultProps` can be converted to functional components.
1 reply 0 retweets 0 likes -
Replying to @WebStormIDE @toddcochran
Possible to refactor classses to functions using hooks for state?
1 reply 0 retweets 0 likes -
Replying to @pkellner @WebStormIDE
Nothing that complicated. Just a plain class with no state.
1 reply 0 retweets 0 likes -
Replying to @toddcochran
Can you please share a code sample to help us reproduce the problem?
1 reply 0 retweets 0 likes -
Replying to @WebStormIDE
so if you have any event or lifecycle in the class it cannot convert it to a functional component? If thats the case, it is not very useful as if all you have is render and props... one line of code away from being functional
1 reply 0 retweets 0 likes
Can you please provide an example showing how a class component that has lifecycle methods should be converted to a function? Do you want to use hooks?
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.