Skip to content

Commit ee4bceb

Browse files
committed
fix: 🐛 getBoundingClientRect on undeined
1 parent f92420d commit ee4bceb

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/components/cursor/cursor.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ export const Cursor: FC<CursorProps> = ({
5151
useEffect(() => {
5252
if (areaRef.current) {
5353
const resizeObserver = new ResizeObserver(() => {
54+
if(!areaRef.current) return;
5455
setWidth(areaRef.current.getBoundingClientRect().width);
5556
});
5657
resizeObserver.observe(areaRef.current!);

0 commit comments

Comments
 (0)