N
Novu2w ago
wasabi

what's up with your docs?

They are as of right now very innacurate. First of, I'm trying to solve an issue and the only place I can go, naturally, is the documentation at docs.novu.co. Yet, it says one thing and the implementation (specifically @novu/react) it's a very different one. Consider the following example: https://docs.novu.co/platform/sdks/react/hooks/use-counts This documentation on the use of the useCount hook in the @novu/react package mentions the return value of the hook being
type CountsReturn = {
data: {
unreadCount: number;
unseenCount: number;
total: number;
};
isLoading: boolean;
error: Error | null;
refetch: () => void;
};
type CountsReturn = {
data: {
unreadCount: number;
unseenCount: number;
total: number;
};
isLoading: boolean;
error: Error | null;
refetch: () => void;
};
When actually, it's
type UseCountsResult = {
counts?: Count[];
error?: NovuError;
isLoading: boolean;
isFetching: boolean;
refetch: () => Promise<void>;
};
type UseCountsResult = {
counts?: Count[];
error?: NovuError;
isLoading: boolean;
isFetching: boolean;
refetch: () => Promise<void>;
};
So either there's something i'm missing or you guys should update the documentation.
useCounts | Novu Documentation
Learn how to use the useCounts hook to fetch notification counts in your React application
5 Replies
Pawan Jain
Pawan Jain2w ago
@wasabi Thanks for reporting. Our documentation needs update
Linear
Linear2w ago
Issue MRK-522 created.
MRK-522 - update @novu/react useCounts hook docs
Status
Triage
Assignee
Pawan Jain
Marketing
wasabi
wasabiOP2w ago
@Pawan Jain https://docs.novu.co/platform/inbox/react/hooks#bell-button-with-unread-count too, mentions a useUnreadCount imported from @novu/react. Which it's not there: from @novu/react/dist/client/index.d.ts:
export { type BaseProps, Bell, type BellProps, type BellRenderer, type DefaultInboxProps, type DefaultProps, Inbox, InboxContent, type InboxContentProps, type InboxProps, InternalNovuProvider, type NotificationProps, Notifications, type NotificationsRenderer, NovuProvider, Preferences, type UseNotificationsProps, type WithChildrenProps, useCounts, useNotifications, useNovu, usePreferences, useUnsafeNovu };
export { type BaseProps, Bell, type BellProps, type BellRenderer, type DefaultInboxProps, type DefaultProps, Inbox, InboxContent, type InboxContentProps, type InboxProps, InternalNovuProvider, type NotificationProps, Notifications, type NotificationsRenderer, NovuProvider, Preferences, type UseNotificationsProps, type WithChildrenProps, useCounts, useNotifications, useNovu, usePreferences, useUnsafeNovu };
Hooks | Novu Documentation
Learn how to build a custom notifications UI using React hooks powered by Novu
Novu_Bot
Novu_Bot2w ago
@wasabi, you just advanced to level 1!
Pawan Jain
Pawan Jain5d ago
@wasabi We fixed the docs for hooks

Did you find this page helpful?