chattr
Version:
A chatgpt chatbot component library for nextjs.
12 lines (11 loc) • 421 B
TypeScript
import React from 'react';
import type { ChattrMessageProps } from '../types';
/**
* Manages automatic scrolling of new content to the bottom of the ChattrFeed.
*
* @param messages An array of ChattrMessage objects.
*
* @returns The reference object used to manipulate the referenced DOM element (the `div`).
*
*/
export default function useScroll(messages: ChattrMessageProps[]): React.RefObject<HTMLDivElement>;