prevent null values setState

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

View File

@ -72,16 +72,20 @@ const Dictionaries = () => {
return (
<div>
<h3>Справочники</h3>
<Select
data={dictionaryOptions}
value={selectedDictionary}
onChange={setSelectedDictionary}
allowDeselect={false}
searchable
<Select
data={dictionaryOptions}
value={selectedDictionary}
onChange={(value) => {
if (value) {
setSelectedDictionary(value)
}
}}
allowDeselect={false}
searchable
nothingFoundMessage="Не найдено..."
maxDropdownHeight={300}
/><br/>
<Button onClick={() => { setCurrentItem(null); setModalOpened(true); }}>Добавить</Button><br/><br/>
/><br />
<Button onClick={() => { setCurrentItem(null); setModalOpened(true); }}>Добавить</Button><br /><br />
<DictionaryTable
data={data}