无法从useEditController获取数据

问题描述

我使用React Admin,并且我想创建一个自定义编辑页面,所以我使用useEditController从dataProvider.getOne()获取数据。但是,当我想重组数据时,由于未定义,它无法这样做。我认为这是因为useEditController是一个异步调用,我们必须在破坏数据之前等待它。

这是MyEdit.js中的代码:

const {
basePath,defaultTitle,loaded,loading,record,redirect,resource,save,saving,version,} = useEditController(props)
const { videoKey } = record

运行此命令时,它说“无法解构'record'的属性'videoKey',因为它是未定义的。”

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)