Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change title property type in core display components <Edit>, <Show>, <View> #9695

Open
antoinefricker opened this issue Mar 1, 2024 · 1 comment

Comments

@antoinefricker
Copy link
Contributor

antoinefricker commented Mar 1, 2024

Is your feature request related to a problem?

In the <Edit>, <Create> and <Show> components, the title property is typed as title?: string | ReactElement;
In our project, we would like to customize title content using the <Title> component within the aforementioned components children. It is now uncomfortable to implement as RA stacks default title and the userland defined title.

Describe the solution you'd like

I would find it very react-admin styled to allow a false value for the title property of the core display components.
It would require to update those, adding a render condition to the <Title> component - here for example

By the way, using an empty string does not do the job as there is a falsy evaluation of the string in <PageTitle>.

Describe alternatives you've considered

None

Additional context

No relevant

@fzaninotto
Copy link
Member

fzaninotto commented Mar 4, 2024

Thanks for your suggestion.

Supporting a falsy value for <Edit title> props does add a bit of flexibility, and we'd welcome a PR for that.

That being said, <Edit> doesn't do much more than rendering the title, actions, and a Card around the page content. If you don't use the Title feature of <Edit>, I suggest you use <EditBase> instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants