Comments (18)
@zackkrida thanks for feedback. I was able to reproduce. Ill handle this ASAP and keep you posed
from vscode-glean.
I believe this should be tagged Stateless to Stateful. Also having this issue, seeing the error:
Property body of ClassMethod expected node to be of a type ["BlockStatement"] but instead got "JSXElement"
from vscode-glean.
@MitchLillie can you please provide an example of code you are trying to refactor?
from vscode-glean.
@zackkrida Fixed by c936135
from vscode-glean.
I will release the version with the fix as soon as recent Github issues are resolved.
from vscode-glean.
@zackkrida Released https://github.com/wix/vscode-glean/releases/tag/v3.3.3 that includes the fix
from vscode-glean.
Hi I have 4.0.2 but have no option to convert the const
style of function to a stateful class which is the only reason I installed it!
from vscode-glean.
@dominictobias the issue the rest in props. The extension code that detects possible actions on selected code seems to have an issue with that. Will fix it ASAP.
For now, if you convert the props object to simple destructuring or remove it all together and just use "props" parameters - it should work.
from vscode-glean.
from vscode-glean.
@dominictobias I've added support for the rest operator in props :) Should be available in v4.0.3 :) Check it out!
from vscode-glean.
That was fast! No extra menu option is coming up for me though (in 4.0.3), here's the snippet I'm highlighting:
const Button = ({
className,
children,
isActive,
size,
...otherProps
}) => (
<button
className={classNames('Button', `Button--size${size}`, className, {
'Button--isActive': isActive,
})}
type="button"
{...otherProps}
>
{children}
</button>
);
from vscode-glean.
@dominictobias works for me on the latest version:
from vscode-glean.
@dominictobias's sample Button code above doesn't work for me with Glean 4.15.2 on VSCode 1.35.1, running on Windows 10.
That "Convert Stateless..." popup menu option simply doesn't appear.
Edited: I originally said it was @borislit's sample code, not @dominictobias .
from vscode-glean.
@brownieboy please provide a code sample you are trying to refactor and ill have a look :)
from vscode-glean.
The Button code in this comment above #19 (comment)
from vscode-glean.
@brownieboy I was unable to reproduce the issue. See the attached GIF. Note that the option DOESNT show up if u select the imports too. Tell me if i can be of any help
from vscode-glean.
Thanks for investigating, @borislit .
Still not working for me. I've tried on two different machines: Windows 10 and Mac OS X Mojave. I still can't see all the menus. You can see that I am not highlighting the import statement:
from vscode-glean.
@brownieboy Sorry for the delay. havent forgotten about this. Just been a bit busy. Ill have all at this ASAP
from vscode-glean.
Related Issues (20)
- Cannot read property `tsAction` of undefined
- Extreme Latency & High Profile Usage HOT 3
- npm install command not working after cloning repo
- Extract to arrow function by default? HOT 1
- Settings: Extract to jsx file instead of tsx
- React Native error: [BABEL] unknown: Preset /* your preset */ requires a filename to be set when babel is called directly. HOT 1
- Extension issue
- Extension issue
- No props validation for Typescript users?
- Extension issue HOT 1
- useEffect refactoring suggestion is overzealous
- When converting from class to function components, useCallback doesn't convert the parameters
- Publish plugin to openVSX
- Prettier cannot run on save HOT 1
- This experimental syntax requires enabling the parser plugin: 'nullishCoalescingOperator' (6:77) HOT 1
- Using Extract Component to File in Client component in NextJS13 breaks it
- Takes too long to save files HOT 1
- Incorrect type. Expected one of string in setting.json
- It doesn't seem to be working HOT 2
- Extension breaks CMD+P file search
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vscode-glean.