Open slikk66 opened 1 year ago
This seems to work, if you rename the config file to .tsx (not .ts)
import { createChatBotMessage } from "react-chatbot-kit";
import WidgetOptions from "./components/WidgetOptions";
import IConfig from "react-chatbot-kit/build/src/interfaces/IConfig";
export const config: IConfig = {
initialMessages: [
createChatBotMessage(`Welcome to our bot!`, {}),
createChatBotMessage(`Would you like to continue?`, {
widget: "widgetOptions",
delay: 2000,
}),
],
widgets: [
{
widgetName: "widgetOptions",
props: {},
mapStateToProps: [],
widgetFunc: (props) => <WidgetOptions {...props} />,
},
],
};
Hi, new user - Having issues with the Widgets using Typescript. Keeps complaining that it doesn't like this construct for "widgetFunc" in TS:
All examples I've seen are in JS, is there any full TS example out there? After trying to fix things up myself, keep getting into more Type errors.
Thanks!