Replies: 3 comments 1 reply
-
For the non resource pages like login, it may be easier to use useDocumentTitle. |
Beta Was this translation helpful? Give feedback.
0 replies
-
is there any one able to get expected output |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hey folks, could you create an issue about this one, ideally with a minimal reproducible example? |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I am currently trying to make some sort of website and I want to modify the name I've made a customTitleHandler.tsx script but it just changes for one second to the default of that and then back to refine here's the code that I have:
This is the app.tsx
<Refine
this is the customTitleHander.tsx
import { IResourceItem, Action } from "@refinedev/core";
interface TitleHandlerOptions {
resource?: IResourceItem;
action?: Action;
params?: Record<string, string | undefined>;
pathname?: string;
}
export const customTitleHandler = ({
pathname
}: TitleHandlerOptions) => {
// Default title
let title = "Michiduta's Playground";
// Custom title logic
if (pathname) {
if (pathname === "/login") {
title = "Login Page";
} else if (pathname === "/register") {
title = "Register Page";
} else if (pathname === "/forgot-password") {
title = "Reset Password Page";
} else if (pathname === "/kanban-board-home") {
title = "Kanban Board";
}
}
return title;
};
This is the index.tsx
import React from "react";
import { createRoot } from "react-dom/client";
import App from "./App";
// Set the document title
document.title = "Michiduta's Playground"; // Set the default title here
const container = document.getElementById("root") as HTMLElement;
const root = createRoot(container);
root.render(
<React.StrictMode>
</React.StrictMode>
);
Beta Was this translation helpful? Give feedback.
All reactions