ReferenceInput 和 DependentInput

ReferenceInput and DependentInput

我有 2 个 ReferenceInput。我想要的是选择一家公司并只显示该公司的分支机构。我试试这个,但它不起作用。 分支机构有一个名为 motherID 的字段,用于将它们与公司联系起来。

<ReferenceInput  source="CompanyID" reference="companies" allowEmpty alwaysOn>
<SelectInput optionText={choice => `${choice.name}`} />
</ReferenceInput>

<DependentInput dependsOn="CompanyID" >
<ReferenceInput  source="BranchID" reference="branches" allowEmpty alwaysOn>
<SelectInput optionText={choice => `${choice.tmima  +" "+ choice.address}`} />
</ReferenceInput>
</DependentInput>

我认为这与 README 中的场景相同:https://github.com/marmelab/aor-dependent-input#re-rendering-the-dependentinput-children-when-the-values-of-the-dependencies-change

你能试试让我们知道进展如何吗?