`react-helmet` warns under `StrictMode`
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 48/100
- Tipo di issue
- Bug
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- react, typescript
- Ambito
- frontend
Direzione di ricerca
Start with ADR 0015 and the migration guide’s page title section, then inspect the shell’s StrictMode wrapper and the Helmet usage described in the issue. Determine how the warning should be handled in the framework and whether the ADR’s proposed library choice is in scope. Done means the chosen approach addresses the React 18 StrictMode warning and leaves app authors with clear guidance.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
react-helmet warns under StrictMode. Every page that sets its title the way ADR 0015 prescribes prints React's UNSAFE_componentWillMount warning in the browser console, once per page load.
Found while porting Learning's progress tab (openedx/frontend-app-learning#2190).
[!NOTE]
The details below were generated by Claude (Claude Code) and reviewed before posting.
Claude Plan
How it happens today
-
An app sets its document title with
<Helmet>fromreact-helmet: ADR 0015 (status Proposed) says "Every route-level page component in an app is responsible for setting the document title. Apps do this with<Helmet>fromreact-helmet", each app declaring the dependency, and the migration guide's Set the document title on every route-level page gives the code. -
react-helmet6.1.0 buildsHelmetonreact-side-effect:withSideEffect(…)(NullComponent).react-side-effect2.1.2 wraps it in a class component namedSideEffect(NullComponent)that definesUNSAFE_componentWillMount. -
The shell renders the site inside
<StrictMode>. -
Observed on a development site running Learning's frontend-base package (
@openedx/frontend-base2.0.0-alpha.17, React 18.3.1,react-helmet6.1.0), in the browser console on loading a page:Warning: Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://reactjs.org/link/unsafe-component-lifecycles for details. * Move code with side effects to componentDidMount, and set initial state in the constructor. Please update the following components: SideEffect(NullComponent) -
react-helmet's latest release on npm is 6.1.0, published 2020-06-08.
What the docs say
- React's
<StrictMode>reference, Fixing deprecation warnings enabled by Strict Mode: "React warns if some component anywhere inside a<StrictMode>tree uses one of these deprecated APIs:UNSAFE_class lifecycle methods likeUNSAFE_componentWillMount." - ADR 0015, Rejected alternatives, Standardizing on
react-helmet-async: "react-helmet-asyncis generally recommended overreact-helmetfor React 18+ projects: it avoidsact()warnings, supports streaming SSR, and is actively maintained." and "Standardizing onreact-helmet-asyncacross all apps is a worthwhile follow-up but does not need to block this decision". The ADR does not mention this warning. - The React 19 release post, Support for Document Metadata: "In the past, these elements would need to be inserted manually in an effect, or by libraries like
react-helmet" and "In React 19, we're adding support for rendering document metadata tags in components natively". - The
react-helmet-asyncREADME (3.1.0 on npm, peerreact16.6 to 19): "This package is a fork of React Helmet.", and under React 19, "Starting with version 3.0.0, this package detects the React version at runtime" and "you may not need this package at all — React 19's built-in metadata handling may be sufficient."
How it got here
- The ADR and the migration guide's section came in with #252 (merged 2026-04-29). The ADR takes the pattern from openedx/frontend-app-authn, which already set titles with
react-helmet(src/login/LoginPage.jsx).
Where it bites
- Learning renders
Helmetinsrc/Main.tsxandsrc/tab-page/LoadedTabPage.tsxof its frontend-base package, which is where the warning above was seen. - The same component is rendered by the route entries of the other converted apps, which were not run for this issue: account, profile, learner dashboard, instructor dashboard, admin console, gradebook, and catalog's home, catalog and course about pages.
Questions
- Does
react-helmet-asyncprint this warning under React 18.3 inStrictMode? Not tested here. - When frontend-base moves to React 19, does React's own
<title>hoisting do what ADR 0015 asks ofHelmet, including one page's title replacing another's across a client-side navigation? Not tested here. - ADR 0015 is still Proposed. Is the library it names part of what is being decided?
- Until the library changes, where does an app author following the migration guide learn that the pattern prints this warning?
- Lingua principale
- TypeScript
- Stelle
- 4
- Fork
- 13
- Merge medio
- 3g 5h
- PR unite (30g)
- 4
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di openedx/frontend-base
-
Export `SkipLink` componentAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
openedx/frontend-base#330 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
openedx/frontend-base#327 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
openedx/frontend-base#210 ·
-
External routes ignore paramsForse già presa @arbrandes l’ha presa oggi. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
openedx/frontend-base#349 · 1 assegnatario ·
-
A site cannot override an installed app's route for a role with an external routeForse già presa @arbrandes l’ha presa oggi. Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
openedx/frontend-base#348 · 1 assegnatario ·
Tutte le issue di openedx/frontend-base
Issue simili
-
clawsweeper:fix-shape-clear clawsweeper:queueable-fix clawsweeper:source-repro impact:ux-friction issue-rating: 🦞 diamond lobster no-stale P3
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
openclaw/openclaw#200365 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
effort: small good first issue priority: medium testing
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
TMHSDigital/screencast-mcp#351 ·
I maintainer di solito rispondono entro 1 giorno
-
area-templates triage:bot-seen triage:needs-human
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
microsoft/aspire#22356 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Archiving an agent that is not loaded keeps its old updatedAtForse già presa @luoph l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
I maintainer di solito rispondono entro 1 giorno
-
content triage
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno