botframework - Botframework - 地图不是函数
问题描述
我正在尝试将 DirectLine 网络聊天嵌入到我的 React 组件中,这是我的代码:
import * as React from 'react';
// import styles from './MyChatClient.module.scss';
import { escape } from '@microsoft/sp-lodash-subset';
import { Chat, DirectLine, App } from 'botframework-webchat'
export default class MyChatClient extends React.Component<MyChatClient, {}> {
botConnection: DirectLine;
_chat: Chat;
constructor(props: MyChatClient) {
super(props);
this.botConnection = new DirectLine({ secret: "G2EBXPrggQcHECliix....." });
}
public render(): React.ReactElement<MyChatClient> {
return (
<Chat
adaptiveCardsHostConfig={{}}
botConnection={this.botConnection}
user={{ id: 'User', name: 'user' }}
bot={{ id: 'botid' }}
resize='detect'
/>
)
}
}
但是,我在浏览器中收到此错误:
Store.ts:676 Uncaught (in promise) TypeError: action$.ofType(...).map is not a function at updateSelectedActivityEpic (Store.ts:676)
我需要做什么具体的事情吗?
谢谢。