import * as React from 'react' ; import { ReferenceField , ReferenceFieldProps , TextField } from 'react-admin' ; interface Props { source ? : string ; } const ProductReferenceField = ( props ) => ( < ReferenceField label = "Product" source = "product_id" reference = "products" { ... props } > < TextField source = "reference" / > < /ReferenceField>); ProductReferenceField . defaultProps = { source : 'product_id' , addLabel : true , } ; export default ProductReferenceField ;