Replace react-document-title with react-helmet#696
Merged
yeasy merged 2 commits intohyperledger-cello:mainfrom Jun 29, 2025
Merged
Replace react-document-title with react-helmet#696yeasy merged 2 commits intohyperledger-cello:mainfrom
yeasy merged 2 commits intohyperledger-cello:mainfrom
Conversation
This commit replaces `react-document-title` with `react-helmet` in both `BasicLayout` and `UserLayout` components. `react-document-title` has limitations when handling dynamic or nested routes. The previous implementation caused issues where the page title would not update correctly when navigating between pages. `react-helmet` integrates better with React's rendering lifecycle, ensuring more predictable and reliable updates. Signed-off-by: dodo920306 <dodo920306@gmail.com>
There was a problem hiding this comment.
Pull Request Overview
This PR replaces the existing react-document-title usage with react-helmet for page title management in layout components and updates dependencies accordingly.
- Replace
<DocumentTitle>wrappers with<Helmet><title>…</title></Helmet>inUserLayoutandBasicLayout - Update imports to use
react-helmetand removereact-document-title - Adjust
package.jsonto drop the old dependency and addreact-helmet
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/dashboard/src/layouts/UserLayout.js | Removed DocumentTitle, added Helmet and fragment wrapper; updated imports |
| src/dashboard/src/layouts/BasicLayout.js | Swapped out DocumentTitle for Helmet and shorthand fragment (<>…</>) |
| src/dashboard/package.json | Deleted react-document-title dependency and added react-helmet |
Comments suppressed due to low confidence (2)
src/dashboard/src/layouts/UserLayout.js:1
- JSX syntax (including fragments
<>...</>) requiresReactto be in scope when using the classic JSX runtime. Since this project uses React 16.x, re-addimport Reactat the top, e.g.:import React, { Component, Fragment } from 'react';.
import { Component, Fragment } from 'react';
src/dashboard/src/layouts/UserLayout.js:1
- The named import
Fragmentisn’t used explicitly (you’re using the shorthand<>...</>). Consider removingFragmentfrom the import to keep imports clean.
import { Component, Fragment } from 'react';
YoungHypo
approved these changes
Jun 28, 2025
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.
This commit replaces
react-document-titlewithreact-helmetin bothBasicLayoutandUserLayoutcomponents.react-document-titlehas limitations when handling dynamic or nested routes.The previous implementation caused issues where the page title would not update correctly when navigating between pages.
react-helmetintegrates better with React's rendering lifecycle, ensuring more predictable and reliable updates.