title property of Edit component does not seem to work
See original GitHub issuePlease do not submit support requests or “How to” questions here. For that, go to StackOverflow.
What you were expecting:
Following the tutorial https://marmelab.com/react-admin/Tutorial.html, when instructing to play with the Edit
component, it should display a title.
export const PostEdit = (props) => (
<Edit title={<PostTitle />} {...props}>
I expect to see the title as in this picture:
Trying a simpler title also does not work:
export const PostEdit = (props) => (
<Edit title="Post edition" {...props}>
What happened instead: I see no title at all:
Steps to reproduce: Just follow the tutorial, and copy-paste the examples
Related code:
const PostTitle = ({ record }) => {
return <span>Post {record ? `"${record.title}"` : ''}</span>;
};
export const PostEdit = (props) => (
<Edit title={<PostTitle />} {...props}>
<SimpleForm>
<DisabledInput source="id" />
<ReferenceInput label="User" source="userId" reference="users">
<SelectInput optionText="name" />
</ReferenceInput>
<TextInput source="title"/>
<LongTextInput source="body"/>
</SimpleForm>
</Edit>
);
Environment
- React-admin version: 2.3.4
- Last version that did not exhibit the issue (if applicable): -
- React version: 16.5.2
- Browser: Chrome 69.0.3497.100
- Stack trace (in case of a JS error): -
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (5 by maintainers)
Top Results From Across the Web
How to fix "Cannot read property 'title' of undefined"
It has an easy solution. The error is displayed because while initializing the html component, product is not ready ( as api call...
Read more >Change custom property without Part Editor
I tried to change properties in the Property Definition Editor but not working. Some properties like "Ref Designator" or "Description" can be manually ......
Read more >Add and Hide Components Using Page Composer
Use the Show Component property to specify whether the component appears to users. By default, all components are visible. To manually hide a...
Read more >Resolve common errors for Dashboard Components
To fix the issue: Edit the Dashboard Properties by changing the Dashboard Layout Style from 2 to 3. Remove components from the extra...
Read more >Editing Page Content | Adobe Experience Manager
Page Title. This is ... This displays the page as it will appear when published. ... Editing does not work on an empty...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You can see your custom title in the blue bar on top.
I’m not sure, but I think this feature has been changed and the example in the tutorial is from the old version. I don’t know if you can still place the title the way it’s displayed in the example picture.
Oups, didn’t mean to close it as we still have to update the documentation screenshots