question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

title property of Edit component does not seem to work

See original GitHub issue

Please 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:

imagen

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:closed
  • Created 5 years ago
  • Comments:8 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
jheiskacommented, Oct 17, 2018

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.

0reactions
djhicommented, Oct 21, 2018

Oups, didn’t mean to close it as we still have to update the documentation screenshots

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found