Open panfiva opened 2 years ago
This is because react-admin's Title
component uses React.createPortal
with the AppBar
as a container, and when you have multiple contents set in the same container, createPortal
behaves this way.
I agree this should be enhanced somehow.
React-helmet has the ability to override previously-set values. Maybe the same approach could work.
Is your feature request related to a problem? Please describe. I have a page that conditionally renders child components. The page uses react-admin's
Title
component to set a title. In most cases, when child component is rendered,Title
should stay the same as in parent component; however, in some conditions, we want to be able to override page's title from within child.Today, if both parent and child component have
Title
rendered, react-admin will just append Title2 to Title1 (will showTitle1Title2
)Describe the solution you'd like if a component or its children have multiple
Title
calls, the last call should win (similar to what react-helmet does while setting page title)Describe alternatives you've considered No clear solution found
Additional context none