r5n-dev / vscode-react-javascript-snippets

Extension for React/Javascript snippets with search supporting ES7+ and babel features
MIT License
1.71k stars 440 forks source link

useState snippet is not working correctly #246

Closed Lamer217 closed 1 year ago

Lamer217 commented 2 years ago

This is what the snippet returns: ('description' added by me when trying out) image

chillios-dev commented 2 years ago

https://user-images.githubusercontent.com/17621507/156024032-fce590b5-9a85-40bb-b966-4aac524bfd96.mov

@Lamer217 hmm are you using newest version? I just tried it on my own and it works fine 🤔

EDIT: Found it's from search.

Lamer217 commented 2 years ago

Seems like everything should be working, but somehow it doesn't. Tried also reinstalling. What info can I provide for easier debugging?

https://user-images.githubusercontent.com/62716818/156372618-6473828b-e7aa-4a33-b032-e7238efa72f8.mp4

ashuvax commented 2 years ago

255

I put a fix to it in the file

priyomukul commented 2 years ago

useStateSnippet is working properly for me (not from snippet search though) but it's not updating the import at the top automatically.

is there any way to fix it. options to solve it? @dsznajder

chillios-dev commented 2 years ago

@priyomukul probably not as it would need to trigger 2 hooks on one input :/ I'm annoyed as you with this 😓 I might ask someone from VSCode team, but currently I'm really out of time :/.