I would like to reuse blocks of input fields. e.g. Use the same group of fields in both Create and Edit forms rather than repeating the code in multiple places.
Documentation shows an example but it uses < Field > elements and trying to use the standard elements like < TextInput > gives errors. https://marmelab.com/blog/2017/01/13/admin-on-rest-0-7.html#use-your-own-component
Is there some scoping issue or something preventing this from working?
I would have expected the following to work fine:
const AddressInputs = (props) => (
<span>
<TextField source="address" {...props} />
{/* Changing from TextField to TextInput gives errors
/ <TextInput source="address" {...props} />
*/}
</span>
)
export const ItemEdit = (props) => (
<Edit {...props}>
<SimpleForm>
<AddressInputs />
</SimpleForm>
</Edit>
);