import { useGetList, AutocompleteInput } from 'react-admin';
const UserCountry = () => {
const { data, isLoading } = useGetList('countries');
// data is an array of { id: 123, code: 'FR', name: 'France' }
return (
<AutocompleteInput
source="country"
choices={data}
optionText="name"
optionValue="code"
isLoading={isLoading}
/>
);
}
自动完成时候显示一条加载信息