I have a shopping list but I want to see the detail in the same list. With what element can I make the touch of the arrow to show me the detail.
<List {...props} >
<Datagrid rowClick="edit" expand={<ItemsProductos />}>
<TextField source="id" />
<TextField source="numero" label="Numero Comprobante" />
<DateField source="fecha" />
</Datagrid>
</List>
React-admin will pass the current record
to the component used as expand
prop, so you can write your <ItemProductos>
component as follows:
const ItemProductos == ({ record }) => (
<span>{record.fecha}</span>
);
This is documented in the react-admin documentation: