[TButtonTab] scrollTop 없을 시 예외처리
This commit is contained in:
@@ -39,15 +39,18 @@ export default function TButtonTab({
|
||||
const onClick = useCallback(
|
||||
(index) => (e) => {
|
||||
if (onItemClick) {
|
||||
if (selectedIndex === index) {
|
||||
if (selectedIndex === index && scrollTop) {
|
||||
return scrollTop();
|
||||
}
|
||||
|
||||
onItemClick({ index, e });
|
||||
scrollTop();
|
||||
|
||||
if (scrollTop) {
|
||||
scrollTop();
|
||||
}
|
||||
}
|
||||
},
|
||||
[selectedIndex]
|
||||
[selectedIndex, scrollTop]
|
||||
);
|
||||
|
||||
return (
|
||||
|
||||
Reference in New Issue
Block a user