react-admin
react-admin copied to clipboard
Dynamic window title
Currently all our admin app browser tabs are named in the same way; and the names in the browser history aren't really helpful neither:
Maybe we could add some useEffect
code to https://github.com/marmelab/react-admin/blob/master/packages/ra-ui-materialui/src/layout/Title.tsx that updates the document.title
whenever new title
is set? WDYT?
How I do it with my React Admin:
class SettingsList extends React.Component {
constructor(props) {
super(props);
}
componentDidMount() {
document.title = "Some new document title.";
}
......
And it shows that in the history and as the title. But maybe a MaterialUI update version is better.
@jtomaszewski Thanks for the suggestion! Would you mind creating a PR for it?
Is someone currently working on this? If not, I'd be happy to give it a shot
@djhi I got carried away 😅
https://github.com/marmelab/react-admin/pull/6118
Fixed by #6119
@fzaninotto can we re-open this issue as the change was reverted. I'm going to give @wmwart's suggestion,
Yep, the fix was reverted in #6357, so I'm reopening it.
FYI, users can customize browser page title using react-helmet. See example code that can be placed in Show, Edit, List or Create components.
<Helmet>
<title>New page title</title>
</Helmet>
FYI, users can customize browser page title using react-helmet. See example code that can be placed in Show, Edit, List or Create components.
<Helmet> <title>New page title</title> </Helmet>
Ideally, the <Title/> component would automatically sent the title over to Helmet, rather than having users add the title to each page / view.
You can use react portals to inject the title into the
It would be great if we can override the Title component as part of the customization / layout