option.id 없는 경우 key 관련 오류 수정
This commit is contained in:
parent
e71def7401
commit
0464cf81ff
@ -18,8 +18,8 @@ export default function QSelectBox({ title = '', options, onChange, value, disab
|
|||||||
<div className={`sort-select ${openSelect ? 'active' : ''}`} onClick={disabled ? () => {} : () => setOpenSelect(!openSelect)}>
|
<div className={`sort-select ${openSelect ? 'active' : ''}`} onClick={disabled ? () => {} : () => setOpenSelect(!openSelect)}>
|
||||||
<p>{selected}</p>
|
<p>{selected}</p>
|
||||||
<ul className="select-item-wrap">
|
<ul className="select-item-wrap">
|
||||||
{options?.map((option) => (
|
{options?.map((option, index) => (
|
||||||
<li key={option.id} className="select-item" onClick={() => handleClickSelectOption(option)}>
|
<li key={option.id || index} className="select-item" onClick={() => handleClickSelectOption(option)}>
|
||||||
<button key={option.id + 'btn'}>{option.name}</button>
|
<button key={option.id + 'btn'}>{option.name}</button>
|
||||||
</li>
|
</li>
|
||||||
))}
|
))}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user