首页 > 解决方案 > web 应用程序上的 react-chatbot-kit

问题描述

我一直在尝试在普通的 html/css/js 网站上使用 react-chatbot-kit,使用编译良好的 webpack 包。但是,弹出窗口不会显示在网页上。已尝试使用 react-simple-chatbot 进行相同的操作,并且效果很好。它不适用于 react-chatbot-kit。

将不胜感激帮助解决它。提前致谢!

干杯

index.js 中使用 react-chatbot-kit 的代码粘贴在下面。

import React from 'react';
import ReactDOM from 'react-dom';
import Chatbot from 'react-chatbot-kit';
import ActionProvider from './components/react-chatbot-kit/ActionProvider';
import MessageParser from './components/react-chatbot-kit/MessageParser';
import config from './components/react-chatbot-kit/config';
import { ThemeProvider } from 'styled-components';

const chatwindowconfig ={
    width: "350px",
    height: "500px",
    floating: true,
};

ReactDOM.render(
    <div>
        <h1>This is the bundle from React!</h1>
        <ThemeProvider theme={theme}>
            <ChatBot
                    config={config} 
                    MessageParser={MessageParser} 
                    ActionProvider={ActionProvider}
                    {...chatwindowconfig}
            />
        </ThemeProvider>

    </div>,
    document.getElementById('root')
)

标签: javascriptreactjs

解决方案


推荐阅读