I have the following edit component
const UserEdit = (props) => (
<Edit {...props}>
<TabbedForm >
<FormTab label="User Account">
<DisabledInput source="id" />
<TextInput source="email" />
<TextInput source="password" type="password"/>
<TextInput source="name" />
<TextInput source="phone" />
<SelectInput source="role" optionValue="id" choices={choices} />
</FormTab>
<FormTab label="Customer Information">
<BooleanInput label="New user" source="Customer.is_new" />
<BooleanInput label="Grandfathered user" source="Customer.grandfathered" />
</FormTab>
</TabbedForm >
</Edit>
);
The second FormTab (Customer Information) I only need it to appear if the User model has some information associated (the JSON is something like):
{
id: <int>,
name: <string>,
....
Customer: {
is_new: true,
grandfathered: true,
}
}
I'd like to know if I can access somehow the model information (in this case, if the Customer key exists and has info) in order to be able to render or not the <FormTab label="Customer Information">
I'm a little bit lost with the global redux state. I know the data is in the state because I've debugged it with the Redux tools. (I tried to look in this.props but I couldn't find anything to access the global state)
Thanks.