Upgrade react-helmet to v6 to fix componentWillMount warning - #4326
Open
samchinmaya wants to merge 1 commit into
Open
samchinmaya wants to merge 1 commit into
samchinmaya wants to merge 1 commit into
Conversation
react-helmet 5 depends on react-side-effect 1, which uses the deprecated componentWillMount lifecycle and logs a React warning for SideEffect(NullComponent). react-helmet 6 uses react-side-effect 2, which renames it to UNSAFE_componentWillMount. v6 still exports Helmet as both a default and a named export, so no code changes are needed. Fixes processing#3833
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Issue:
Fixes #3833
The
componentWillMount has been renamedwarning forSideEffect(NullComponent)still appears ondevelop(see my comment on the issue). It isn't from the editor component: it comes fromreact-side-effect@1.1.5, a dependency ofreact-helmet@5.2.1, which we use in 19 components to set page titles.Demo:
No UI change. Page titles are set the same way as before, checked in the browser on the IDE, About, Login, Signup, Reset Password, Privacy Policy, Terms of Use, full view, saved sketch, sketch list and collection list pages, plus client-side navigation (
About→Loginupdates the title).Warning count in
npm run test(client project):componentWillMountwarningsindex.integration.test.jsx,AddToCollectionSketchList.unit.test.jsx,Preferences.unit.test.jsx,SketchList.unit.test.jsx)Changes:
react-helmetfrom^5.1.3to^6.1.0. v6 depends onreact-side-effect@2, which usesUNSAFE_componentWillMountinstead.Helmetas both a default export (used inFullView.jsx,Legal.tsx) and a named export (used everywhere else).react-helmet,react-side-effect,react-fast-compare, and removingexenv(no longer needed byreact-side-effect@2).Longer term,
react-helmet-asyncis the maintained alternative, but it needs aHelmetProviderwrapper around the app and the test render helper, so I kept this PR to the minimal fix.I have verified that this pull request:
npm run lint)npm run test) — all client tests pass; in my local Docker setupserver/models/__test__/user.test.tsfails ondeveloptoo, becausemongodb-memory-servercan't download MongoDB 7.0.0 for Debian 12 (unrelated to this change)npm run typecheck)developbranch.Fixes #123