Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/nuka/src/Carousel/Carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,12 @@ export const Carousel = forwardRef<SlideHandle, CarouselProps>(
});

// -- forward events to ref
useImperativeHandle(ref, () => ({ goForward, goBack, goToPage }), [
useImperativeHandle(ref, () => ({ goForward, goBack, goToPage, totalPages, currentPage }), [
goForward,
goBack,
goToPage,
totalPages,
currentPage
]);
Comment on lines +124 to 130
Copy link

Copilot AI Apr 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useImperativeHandle is typed with forwardRef<SlideHandle, ...>, but SlideHandle (in packages/nuka/src/types.ts) currently only includes goForward/goBack/goToPage. Returning an object literal with totalPages and currentPage will fail TypeScript excess-property checking here. Please extend SlideHandle to include these new numeric fields (and ensure the public type export is updated accordingly).

Copilot uses AI. Check for mistakes.

// -- autoplay
Expand Down