sunny-green
sunny-greenโ€ข17mo ago

Way to identify the non-resource pages.

Is there any we can identify the dashboard page when shown? for example we can identify a resource page with useResource hook when it appears in the page.
10 Replies
like-gold
like-goldโ€ข17mo ago
| refine
`` component is the entry point of a refine app. It is where the highest level of configuration of the app occurs.
sunny-green
sunny-greenโ€ข17mo ago
this is for a custom dashboard page. its not what I wanted. actually I am working on this issue. https://github.com/refinedev/refine/issues/2810
GitHub
[FEAT] Dynamic window title ยท Issue #2810 ยท refinedev/refine
Is your feature request related to a problem? Please describe. It would be great if each page could have an auto-generated and custom title. Example, For the Posts resource dashboard -> Dash...
sunny-green
sunny-greenโ€ข17mo ago
I am able to customize the title for resource pages. but not for the dashboard page, inside RouterProvider
like-gold
like-goldโ€ข17mo ago
Sorry for misunderstand โšก Let's discuss with core team and back to you ๐Ÿš€
sunny-green
sunny-greenโ€ข17mo ago
sure ๐Ÿ‘
like-gold
like-goldโ€ข17mo ago
We talked about this with the core team. We cannot detect that we are currently on the dashboard page. This page is being created by the user can use the useDocumentTitle hook. Also, we will release a new refine4 version. (https://github.com/orgs/refinedev/projects/2/views/1?pane=issue&itemId=19438576) In this version routerProvider will be removed. It will be recommended to use this hook directly for the dashboard.
sunny-green
sunny-greenโ€ข17mo ago
ok understood.
sunny-green
sunny-greenโ€ข17mo ago
I already created a pr for handling the custom page title for resource pages in react-router-v6. it's still in progress. Can you please take a look at it whether I am going right or wrong https://github.com/refinedev/refine/pull/3546
GitHub
WIP: Add custom hook for updating page title dynamically. by sebabr...
Update page title dynamically Provide a custom hook useDocumentTitle to customize the page title Apply it for react-router-v6 Apply it for nextjs-router Test plan (required) No test till now ...
sunny-green
sunny-greenโ€ข17mo ago
@yildirayunlu , as you said that routerProvider props will be removed. So is it a valid approach to make changes in any router packages? I think every router package is completely independent. so it will not create any problems.
like-gold
like-goldโ€ข17mo ago
Yes the useDocumentTitle hook will work correctly. Thank you for your effort, we are grateful ๐Ÿ™๐Ÿผ