Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: update useEffect dependency, handleChange #280

Merged
4 changes: 2 additions & 2 deletions DEPENDENCIES
Original file line number Diff line number Diff line change
Expand Up @@ -811,7 +811,7 @@ npm/npmjs/@babel/helper-wrap-function/7.25.0, MIT, approved, clearlydefined
npm/npmjs/@babel/helpers/7.25.0, MIT, approved, clearlydefined
npm/npmjs/@babel/highlight/7.24.7, MIT AND (BSD-2-Clause AND ISC AND MIT) AND BSD-2-Clause AND BSD-3-Clause, approved, #13941
npm/npmjs/@babel/parser/7.24.8, MIT AND (BSD-2-Clause AND ISC AND MIT) AND BSD-2-Clause AND BSD-3-Clause, approved, #13492
npm/npmjs/@babel/parser/7.25.3, MIT, approved, clearlydefined
npm/npmjs/@babel/parser/7.25.3, MIT AND (BSD-2-Clause AND ISC AND MIT) AND BSD-2-Clause AND BSD-3-Clause, approved, #16041
npm/npmjs/@babel/plugin-bugfix-firefox-class-in-computed-class-key/7.25.3, MIT, approved, clearlydefined
npm/npmjs/@babel/plugin-bugfix-safari-class-field-initializer-scope/7.25.0, MIT, approved, clearlydefined
npm/npmjs/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/7.25.0, MIT, approved, clearlydefined
Expand Down Expand Up @@ -915,7 +915,7 @@ npm/npmjs/@babel/template/7.24.7, MIT, approved, clearlydefined
npm/npmjs/@babel/template/7.25.0, MIT, approved, clearlydefined
npm/npmjs/@babel/traverse/7.24.8, MIT AND (BSD-2-Clause AND ISC AND MIT) AND BSD-2-Clause AND BSD-3-Clause, approved, #13926
npm/npmjs/@babel/traverse/7.25.3, MIT, approved, clearlydefined
npm/npmjs/@babel/types/7.25.2, MIT, approved, clearlydefined
npm/npmjs/@babel/types/7.25.2, MIT AND (BSD-2-Clause AND ISC AND MIT) AND BSD-2-Clause AND BSD-3-Clause, approved, #16040
npm/npmjs/@base2/pretty-print-object/1.0.1, BSD-2-Clause, approved, clearlydefined
npm/npmjs/@bcoe/v8-coverage/0.2.3, ISC AND MIT, approved, clearlydefined
npm/npmjs/@chromatic-com/storybook/1.6.1, MIT AND (BSD-2-Clause AND ISC AND MIT), approved, #15710
Expand Down
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