How do I include object in DataGrid or SimpleForm in react-admin?

Viewed 68

How do I render an object with another object in it? E.g. I have a user object which has a field baseProfile which all look like this:

  • User
    • Id: String
    • Name: String
    • Address: String
    • BaseProfile:
      • password: String
      • email: String
      • ......

I can easily use a SimpleForm or DataGrid to show or edit the first layer of data, how to show or edit the child object?

1 Answers

All inputs and field accept a path with dots.

<TextInput type="password" source="BaseProfile.password" />
<TextInput type="email" source="BaseProfile.email" />
Related