prevent null values setState
This commit is contained in:
@ -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}
|
||||
|
||||
Reference in New Issue
Block a user