flat-fuchsia
flat-fuchsiaโ€ข2y 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
constant-blue
constant-blueโ€ข2y ago
| refine
`` component is the entry point of a refine app. It is where the highest level of configuration of the app occurs.
flat-fuchsia
flat-fuchsiaโ€ข2y 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...
flat-fuchsia
flat-fuchsiaโ€ข2y ago
I am able to customize the title for resource pages. but not for the dashboard page, inside RouterProvider
constant-blue
constant-blueโ€ข2y ago
Sorry for misunderstand โšก Let's discuss with core team and back to you ๐Ÿš€
flat-fuchsia
flat-fuchsiaโ€ข2y ago
sure ๐Ÿ‘
constant-blue
constant-blueโ€ข2y 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.
flat-fuchsia
flat-fuchsiaโ€ข2y ago
ok understood.
flat-fuchsia
flat-fuchsiaโ€ข2y 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 ...
flat-fuchsia
flat-fuchsiaโ€ข2y 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.
constant-blue
constant-blueโ€ข2y ago
Yes the useDocumentTitle hook will work correctly. Thank you for your effort, we are grateful ๐Ÿ™๐Ÿผ