p5.js-web-editor
p5.js-web-editor copied to clipboard
prefer react-i18next `useTranslation` hook
Changes:
- In existing function components, access the
tfunction fromreact-i18nextviaconst { t } = useTranslation();rather than thewithTranslationHOC or by passing it down from a parent. - Converted
EditorAccessibilityErrorModal, andShareModalfrom 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
developbranch. - [ ] is descriptively named and links to an issue number, i.e.
Fixes #123
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