Represents a chat view component.
function App(): React.ReactElement { const [chatCtl] = React.useState(new ChatController()); React.useMemo(async () => { // Chat content is displayed using ChatController await chatCtl.addMessage({ type: 'text', content: `Hello, What's your name.`, self: false, }); const name = await chatCtl.setActionRequest({ type: 'text' }); }, [chatCtl]); // Only one component used for display return <Chat chatController={chatCtl} />;} Copy
function App(): React.ReactElement { const [chatCtl] = React.useState(new ChatController()); React.useMemo(async () => { // Chat content is displayed using ChatController await chatCtl.addMessage({ type: 'text', content: `Hello, What's your name.`, self: false, }); const name = await chatCtl.setActionRequest({ type: 'text' }); }, [chatCtl]); // Only one component used for display return <Chat chatController={chatCtl} />;}
The props object.
React component.
Represents a chat view component.
Example