Skip to content

Commit cee214a

Browse files
committed
docs(time-picker): add loop prop documentation and demo
1 parent d376ae1 commit cee214a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

components/time-picker/time-panel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ const TimePanel = (props: TimePanelProps): React.ReactElement => {
1818
const itemRefs = useRef<Map<number, HTMLLIElement>>(new Map());
1919
const isResetting = useRef(false);
2020
const clickedRef = useRef(false);
21-
const scrollToItemRef = useRef<(val: number) => void>(null!);
21+
const scrollToItemRef = useRef<((val: number) => void) | null>(null);
2222

2323
const oneGroupHeight = items.length * ITEM_HEIGHT;
2424

@@ -46,7 +46,7 @@ const TimePanel = (props: TimePanelProps): React.ReactElement => {
4646
clickedRef.current = false;
4747
return;
4848
}
49-
scrollToItemRef.current(value);
49+
scrollToItemRef.current?.(value);
5050
}, [value]);
5151

5252
// Scroll reset for loop mode

0 commit comments

Comments
 (0)