wix-incubator / vscode-glean

The extension provides refactoring tools for your React codebase
MIT License
1.46k stars 56 forks source link

class instance variables is not to converted to its equivalent useRef in hooks #77

Closed RamyEl-basyouni closed 4 years ago

RamyEl-basyouni commented 5 years ago

while converting stateful component to hook, instances variables in class is not coverted to its equivalent in hooks which is useRef(). https://reactjs.org/docs/hooks-faq.html#is-there-something-like-instance-variablesso any code with syntax: this.sView should be: const sView = useRef()

borislit commented 5 years ago

I agree @RamyEl-basyouni . I've been pondering about this myself. Care for a PR? I'd love to point you in the right direction?

borislit commented 4 years ago

Hey @RamyEl-basyouni! I've just released a new version that supports useRef. I'd love for some feedback

borislit commented 4 years ago

:tada: This issue has been resolved in version 4.19.0 :tada:

The release is available on GitHub release

Your semantic-release bot :package::rocket: