Skip to content

Commit

Permalink
fix: update useEffect dependency, handleChange
Browse files Browse the repository at this point in the history
  • Loading branch information
oyo authored Sep 11, 2024
2 parents 8fd41d3 + 115dc7a commit aac007d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/components/basic/SelectList/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export const SelectList = ({

useEffect(() => {
setSelected(defaultValue)
}, [defaultValue])
}, [JSON.stringify(defaultValue)])

// eslint-disable-next-line
const handleChange = (newValue: any) => {
Expand All @@ -95,7 +95,7 @@ export const SelectList = ({
// eslint-disable-next-line
getOptionLabel={(option) => option[keyTitle] || ''}
onChange={(_event, nextValue) => {
handleChange(nextValue)
handleChange(nextValue ?? {})
}}
isOptionEqualToValue={(option, value) => isEqual(option, value)}
renderOption={(props, option, { inputValue }) => (
Expand Down

0 comments on commit aac007d

Please sign in to comment.