useThreadContext
Use the useThreadContext
hook to access context from <Thread.Root>
.
import { Thread, useThreadContext } from '@superinterface/react'
const Info = () => {
const { variables } = useThreadContext()
return <div>{variables.threadId}</div>
}
export const App = () => (
<Thread.Root variables={{ threadId: 'thread_123' }}>
<Info />
</Thread.Root>
)
Arguments
No parameters available.
Returns
useThreadContext
returns the same values provided to <Thread.Root>
, such as variables
, plus any helpers exposed by the thread context.