MCPcopy Index your code
hub / github.com/TanStack/query / ChatMessage

Function ChatMessage

examples/react/chat/src/index.tsx:25–39  ·  view source on GitHub ↗
({ question }: { question: string })

Source from the content-addressed store, hash-verified

23}
24
25function ChatMessage({ question }: { question: string }) {
26 const { error, data = [], isFetching } = useQuery(chatQueryOptions(question))
27
28 if (error) return 'An error has occurred: ' + error.message
29
30 return (
31 <div>
32 <Message message={{ content: question, isQuestion: true }} />
33 <Message
34 inProgress={isFetching}
35 message={{ content: data.join(' '), isQuestion: false }}
36 />
37 </div>
38 )
39}
40
41function Example() {
42 const [questions, setQuestions] = useState<Array<string>>([])

Callers

nothing calls this directly

Calls 2

useQueryFunction · 0.90
chatQueryOptionsFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…