Skip to content

Commit 518292e

Browse files
committed
optimize: optimize error
1 parent 7b9223c commit 518292e

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

packages/ui/src/components/carousel/context.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
'use client';
2-
32
import { createContext, useContext } from 'react';
43

54
import type { CarouselContextProps } from './types';
@@ -10,7 +9,7 @@ export function useCarousel() {
109
const context = useContext(CarouselContext);
1110

1211
if (!context) {
13-
throw new Error('useCarousel must be used within a <Carousel />');
12+
throw new Error('useCarousel must be used within a <CarouselRoot />');
1413
}
1514

1615
return context;

0 commit comments

Comments
 (0)