Which order when refactoring ReactJs App (Starting with tests, typescript, hooks)

Viewed 54

I created a React Application. Now, time has come to start with refactoring and make it stable for the enhancements in the future. I would like to:

  • Add tests (at the moment I do not have tests in my code)
  • Switch from JavaScript to Typescript
  • Switch to Hooks API (at the moment I use classes)

Usually I would say, that it makes sense to start with a migration to typescript, add test-coverage and afterwards refactor with Hooks. But I am not sure, if the changes which comes with hooks let me still make use of the test-cases or if I have to rewrite a large part of the tests.

In which order would you introduce these three basic changes?

Thanks a lot

0 Answers
Related