使用自定义Symfony设置在API平台中自定义资源

使用自定义Symfony设置在API平台中自定义资源,symfony,react-admin,api-platform.com,Symfony,React Admin,Api Platform.com,我正在使用API平台的自定义设置(Symfony 5+API包+管理包)。我正在尝试使用以下内容自定义资源列表 const entrypoint = document.getElementById('api-entrypoint').innerText; const PropertyCreate = props => ( <CreateGuesser {...props}> ... </CreateGuesser> ); const

我正在使用API平台的自定义设置(Symfony 5+API包+管理包)。我正在尝试使用以下内容自定义资源列表

const entrypoint = document.getElementById('api-entrypoint').innerText;
const PropertyCreate = props => (
    <CreateGuesser {...props}>
        ...
    </CreateGuesser>
);
const PropertyEdit = props => (
    <EditGuesser {...props}>
        ...
    </EditGuesser>
);

export default () => (
    <HydraAdmin
        apiDocumentationParser={apiDocumentationParser}
        dataProvider={dataProvider}
        authProvider={authProvider}
        entrypoint={entrypoint}
    >
        <Resource name="properties" create={PropertyCreate} edit={PropertyEdit} />
    </HydraAdmin>
);

ReactDOM.render(<HydraAdmin entrypoint={entrypoint}/>, document.getElementById('api-platform-admin'));
const entrypoint=document.getElementById('api-entrypoint')。innerText;
const PropertyCreate=props=>(
...
);
常量属性编辑=道具=>(
...
);
导出默认值()=>(
);
ReactDOM.render(,document.getElementById('api-platform-admin');
但是由于某些原因,管理员没有选择更改。它显示创建和编辑表单的默认视图。
谢谢。

看起来很简单:

export const BookingsAdmin =
    <HydraAdmin
        apiDocumentationParser={apiDocumentationParser}
        dataProvider={dataProvider}
        entrypoint={entrypoint}
    >
        <Resource name="properties" create={PropertyCreate} edit={PropertyEdit}/>
        <Resource name="bookings" list={BookingsList}/>
    </HydraAdmin>;

ReactDOM.render(BookingsAdmin, document.getElementById('api-platform-admin'));
export const BookingsAdmin=
;
render(BookingsAdmin,document.getElementById('api-platform-admin');

导出默认值。。。在安装后,存在于admin.js文件中。我认为这是我必须改变的部分。但是看起来ReactDOM.render使它完全无用。如果我将更改添加到ReactDOM.render,则不会呈现管理员。