Disable Fields
The disabled
prop can be used on either component.
import React, { useState } from 'react';
import { CountryDropdown, RegionDropdown } from 'react-country-region-selector';
const DisableFields = () => {
const [country, setCountry] = useState('');
const [region, setRegion] = useState('');
return (
<>
<CountryDropdown
value={country}
onChange={(val) => setCountry(val)}
disabled={true}
/>
<RegionDropdown
country={country}
value={region}
onChange={(val) => setRegion(val)}
disabled={true}
/>
</>
);
};
export default DisableFields;