refactor: remove inline function

This commit is contained in:
unknown 2021-08-30 13:54:37 +07:00
parent de5278fa96
commit 648a7349c5

View File

@ -35,6 +35,10 @@ const SelectCommon = ({ type = 'default', size = 'base', option, children }: Pro
setActive(!isActive)
}
const changeSelectedName = (props:string) => {
setSelectedName(props)
}
return(
<>
<div className={classNames({
@ -64,7 +68,7 @@ const SelectCommon = ({ type = 'default', size = 'base', option, children }: Pro
[s.selectOption] : true,
[s[size]] : !!size,
})}
onClick = { () => setSelectedName(item.name) }
onClick = { changeSelectedName(item.name) }
>{item.name}</div>
)
}