- 🆕 update of the configuration value will update entities which rely on it.
const [locale, setLocale] = useState<'en' | 'uk'>('en');
const {
data: { weekDays }
} = useDatePicker({
locale: { locale }
});
const onSetEnLocale = () => setLocale('en');
const onSetUkLocale = () => setLocale('uk');
render (
<>
<button onClick={onSetEnLocale}>Set English Locale</button>
<button onClick={onSetUkLocale}>Set Ukrainian Locale</button>
{weekDays.map((day) => (<div key={day}>{day}</div>))}
</>
)
After the user will click on any button locale and weekDays value will be changed.