For example, I have two endpoints:
/level/
{
"id": 1,
"type": 1
"field": 2
}
/level_type/
{
"id": 1,
"value": "test1"
}
{
"id": 2,
"value": "test2"
}
I created component:
export const LevelEdit = (props) => {
return <Edit {...props}>
<SimpleForm>
<ReferenceInput source="type" reference="level_type">
<SelectInput optionText="value"/>
</ReferenceInput>
<DependentInput dependsOn="type.value" value="type2">
<NumberInput source="field"/>
</DependentInput>
</SimpleForm>
</Edit>
};
I want that NumberInput depends on a nested field (from ReferenceInput). NumberInput will appear if I select level_type.id = 2 where value = "type2".
How can I do it?