useLatestMessage

Use the useLatestMessage hook to get the latest thread message.
app.tsx
import { useLatestMessage, } from '@superinterface/react' export const App = () => { const { latestMessage } = useLatestMessage() return ( <div> {latestMessage?.id} </div> ) }

Arguments

No parameters available.
To modify variables passed to the mutation, use variables field of <SuperinterfaceProvider> or <Thread.Root>. To set other query options, use defaultOptions from <SuperinterfaceProvider> or <Thread.Root>.

Returns

Here's a summary of useLatestMessage return properties:
PropType
latestMessageMessage
Good to know:
useLatestMessage additionally returns all props from useMessages and Tanstack Query useInfiniteQuery. So you can use props like isFetching, refetch and so on.