Skip to content

Conversation

@dodo920306
Copy link
Contributor

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.

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 <[email protected]>
@YoungHypo YoungHypo requested a review from Copilot June 20, 2025 23:54
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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> in UserLayout and BasicLayout
  • Update imports to use react-helmet and remove react-document-title
  • Adjust package.json to drop the old dependency and add react-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 <>...</>) requires React to be in scope when using the classic JSX runtime. Since this project uses React 16.x, re-add import React at 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 Fragment isn’t used explicitly (you’re using the shorthand <>...</>). Consider removing Fragment from the import to keep imports clean.
import { Component, Fragment } from 'react';

@yeasy yeasy requested a review from YoungHypo June 25, 2025 02:24
@yeasy yeasy merged commit 71046a6 into hyperledger-cello:main Jun 29, 2025
3 checks passed
@dodo920306 dodo920306 deleted the fix/title-stop-updating-on-route-change branch June 29, 2025 00:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants