React-Admin: map custom data object into a <List>

Is it possible to fill a Datagrid with an array of objects coming from an external request (not a Dataprovider)?
Our BE doesn’t have the right grammar to be "accepted" by RA interceptor so I’m doing the requests "by myself", but I’ve got a little bit stuck on the right way to use RA on this case

Something like this(?):

 <List {...props} title="Users List">
    {usersDataProvider &&
      usersDataProvider.map((data) => {
        return (
          <Datagrid>
            <TextField source={data.id} />
            <TextField source={data.name} />
            <TextField source={data.email} />
          </Datagrid>
        );
      })}
  </List>

86 thoughts on “React-Admin: map custom data object into a <List>”

Leave a Comment