React-admin 将无法正确添加 id 以显示视图 url

React-admin will not properly add id to show view url

我无法让我的显示视图正常工作。我收到一条错误消息:

Element not found

我的 mongodb 中的 _id 数据是字符串而不是 ObjectID。我不认为这是问题所在,但在数据库中某些 id 的开头添加了一些破折号。我的展示组件如下所示:

import React from "react";
   import {Show, SimpleShowLayout,DateField, TextField,BooleanField,NumberField,TabbedShowLayout,Tab
   } from "react-admin";
   import { GridTab } from "../../../common/components/layout/Grid/GridTab";
   import { ReferenceGridTab } from "../../../common/components/layout/Grid/ReferenceGridTab";

   export const JssSessionShow = props => (
       <Show title="Session View" {...props}>
         <SimpleShowLayout>
           <TextField source="session" />
           <DateField source="expires" />
           <TextField source="id" />
        </SimpleShowLayout>
   </Show>
 );

我不知道如何将我的 ID 正确添加到 url 以显示我的显示视图。请有人帮我解决这个问题。

我能够解决这个问题。数据提供者使用的后端没有与正确的来源对话。