useMessages
Use the useMessages
hook to get thread messages.
import {
useMessages,
} from '@superinterface/react'
import {
Message,
} from '@superinterface/react/types'
export const App = () => {
const { messages, isFetching } = useMessages()
if (isFetching) {
return (
<div>
Loading...
</div>
)
}
return (
<>
{messages.map((message: Message) => (
<div
key={message.id}
>
{message.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 useMessages
return properties: