Function ChatView

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} />;
}
  • Parameters

    • props: IChatViewProps

      The props object.

    Returns Element

    React component.