wix-incubator / vscode-glean

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

Using Hooks to replace setState calls #27

Closed borislit closed 5 years ago

borislit commented 6 years ago

Today, when class components is refactored to the functional component, all setState calls are lost, as there was no equivalent concept. Today, after Hooks have been introduced, they seem to be just that. It would be awesome to explore such a possibility. This should be an opt-in feature (using configuration)

itzsaga commented 6 years ago

When should this be explored? Hooks are still an early stage proposal and I think Dan said it best in this tweet https://twitter.com/dan_abramov/status/1057027428827193344

borislit commented 6 years ago

@itzsaga I agree, and for this very reason what i was thinking was to have it as an "opt in" feature which you would turn on through a config parameter. Also, that also means that the code for that feature would have to be isolated.