Closed habibunnish closed 1 month ago
Hey @habibunnish, I'm going to need more information (and ideally improved code formatting above). What data are you referring to? Could you highlight the specific part you're having issues with? Thanks!
on here its only accepting string messages
const flow = { start: { message: "Hey! Welcome to shopping Assistant!", path: "loop", }, loop: { message: async () => { return "hello world" }, path: "loop", // Continue the loop after response }, };
but if i try to pass object like this as div element its not showing in ui
const flow = { start: { message: "Hey! Welcome to shopping Assistant!", path: "loop", }, loop: { message: async () => { return
hello world
@habibunnish If you're looking to use a div replace message
with component
instead.
can u show me with an example how to do it
can u show me with an example how to do it
You can take a look at this example: https://react-chatbotify.com/docs/examples/custom_component
yeah ok thanks alot @tjtanjin
Feel free to reach out again if you need more clarifications!
yeah sure.
const flow = { start: { message: "Hey! Welcome to Rufus-Gpt!", path: "loop", }, loop: { component: () => (
Hello world
),
path: "loop",
},
};
return ( <> {isLoaded && ( <Suspense fallback={
shop new
},
tooltip: {
mode: "CLOSE",
text: "Your Shopping Assistant .",
},
general: {
embedded: false,
showFooter: false,
primaryColor: "#636466",
secondaryColor: "#855AA6",
} notification: {
disabled: true,
},
chatHistory: { storageKey: "example_smart_conversation" },
}}
flow={flow}
/>
</Suspense>
)}
</>
);
I have written my code like this but still its not showing in ui where am i going wrong can you plz telll me
const flow = { start: { message: "Hey! Welcome to Gpt!", path: "loop", }, loop: { component: () => (
Hello world
),
path: "loop", // Keep the flow looping
},
};
return ( <> {isLoaded && ( <Suspense fallback={
Aspire Auras
},
tooltip: {
mode: "CLOSE",
text: "Your Shopping Assistant ",
},
general: {
embedded: false,
showFooter: false,
primaryColor: "#636466",
secondaryColor: "#855AA6",
},
chatButton: {
icon: "/auras-white.png",
},
notification: {
disabled: true,
},
chatHistory: { storageKey: "example_smart_conversation" },
}}
flow={flow}
/>
</Suspense>
)}
</>
);
this is the complete code
You're not passing in an element into component
, check the syntax and reference the example 🥹
component: () => (
Hello world
),
inside <div/> element and <p/> element iam passing hello world
component: () => (
Hello world
),
There's no <div>
or <p>
seen here :3
i dont know why its not showing to you when iam sending comment it erasing the div element from component and going
i dont know why its not showing to you when iam sending comment it erasing the div element from component and going
Wrap your entire code with a codeblock, or perhaps take a screenshot
What version of the library are you on?
"react-chatbotify": "^2.0.0-beta.7"
"react-chatbotify": "^2.0.0-beta.7"
Try moving to beta.20. If that still doesn't work, is the component not appearing for you completely or is there some error or anything else happening?
I got the soln now its working as i expected i created separate customMessageComponent and called that component
Bug Description Provide a clear and concise description of the bug.
Steps To Reproduce Steps to reproduce the bug behavior: "use client"; import { lazy, Suspense, useEffect, useState } from "react"; const ChatBot = lazy(() => import("react-chatbotify"));
const ChatBot = () => { const [isLoaded, setIsLoaded] = useState(false);
useEffect(() => { setIsLoaded(true); }, []);
const flow = { start: { message: "Hey! Welcome to shopping Assistant!", path: "loop", }, loop: { message: async () => { return
hello world
return ( <> {isLoaded && ( <Suspense fallback={
export default ChatBot;
Expected behavior I need data in object manner but its only supporting in string
Desktop (please complete the following information):
Mobile (please complete the following information):