prevent null values setState

This commit is contained in:
2025-09-02 12:18:22 +09:00
parent 398425d022
commit e0c70ccbe9

View File

@ -75,13 +75,17 @@ const Dictionaries = () => {
<Select <Select
data={dictionaryOptions} data={dictionaryOptions}
value={selectedDictionary} value={selectedDictionary}
onChange={setSelectedDictionary} onChange={(value) => {
if (value) {
setSelectedDictionary(value)
}
}}
allowDeselect={false} allowDeselect={false}
searchable searchable
nothingFoundMessage="Не найдено..." nothingFoundMessage="Не найдено..."
maxDropdownHeight={300} maxDropdownHeight={300}
/><br/> /><br />
<Button onClick={() => { setCurrentItem(null); setModalOpened(true); }}>Добавить</Button><br/><br/> <Button onClick={() => { setCurrentItem(null); setModalOpened(true); }}>Добавить</Button><br /><br />
<DictionaryTable <DictionaryTable
data={data} data={data}