p5.js-web-editor icon indicating copy to clipboard operation
p5.js-web-editor copied to clipboard

prefer react-i18next `useTranslation` hook

Open lindapaiste opened this issue 2 years ago • 1 comments

Changes:

  • In existing function components, access the t function from react-i18next via const { t } = useTranslation(); rather than the withTranslation HOC or by passing it down from a parent.
  • Converted EditorAccessibility ErrorModal, and ShareModal from class components to function components as they didn't use any lifecycle methods, so the conversion is trivial.

I'm not sure if it's better to do refactoring on a "one change at a time" basis like this, or a "one component at a time" basis. The advantages of "one change at a time" is that it avoids versioning issues for dependencies such as react-router which need to be updated before we can use hooks.

I have verified that this pull request:

  • [x] has no linting errors (npm run lint)
  • [x] has no test errors (npm run test)
  • [x] is from a uniquely-named feature branch and is up to date with the develop branch.
  • [ ] is descriptively named and links to an issue number, i.e. Fixes #123

lindapaiste avatar Jul 19 '22 17:07 lindapaiste

Release Environments

This pull request environment is provided by Release, learn more! To see the status of the environment click on Environment Status below.

  • p5.js-web-editor

:wrench:Environment Status : https://app.releasehub.com/public/Processing%20Foundation/env-ddc90c8f70

release-com[bot] avatar Aug 02 '22 17:08 release-com[bot]