如何修复 React 无法识别 `basePath` 警告?

How to fix the React does not recognize the `basePath` warning?

我使用 react-admin,对于 API,我使用 useQuery,我的所有页面都有这个警告:

Warning: React does not recognize the basePath prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase basepath instead. If you accidentally passed it from a parent component, remove it from the DOM element.
in div (created by ForwardRef(Grid))
in ForwardRef(Grid) (created by WithStyles(ForwardRef(Grid)))

我该如何解决?

不确定这是否是您的确切问题,因为没有提供任何代码,但我认为它值得分享。我在资源的创建和编辑组件中收到了相同的警告,我在其中使用了 SimpleForm。

我使用 MUI 网格来格式化这些组件。

但是,SimpleForms 只接受输入组件,例如 TextInput、AutocompleteInput、NumberInput 等。解决方案似乎是创建一个自定义表单组件,它能够处理不同类型的输入。

Source 来自本人本人