react-simple-chatbot icon indicating copy to clipboard operation
react-simple-chatbot copied to clipboard

How to call handleEnd callback before the end flag is set to true

Open mihailpreda opened this issue 4 years ago • 3 comments

Describe the problem I want to make a bot that answers to computer science related questions. For prepared questions like What is a variable? ,I've use the options button and offered diffrent answers. But I offer the posibility to the user to ask the bot a questions. My problem is following after the user enters the questions I set the end flag true and thus my data is send from chatBot to ThemedProvider and then to Root Component where I do a select some words from it and reply with an video from my database. After that the I can't ask anymore questions or enter anything (because the end flag it is set to true).

The Question Can I trigger the handleEnd callback before end flag, or is it any other way in which can i send state from chatbot to parent components ?

mihailpreda avatar Feb 17 '20 19:02 mihailpreda

I believe you can do some similar to this example

LucasBassetti avatar Feb 18 '20 13:02 LucasBassetti

I believe you can do some similar to this example

In that exemple it is done inside the chatbot component. I need the values outside the chatbot. Here is a exemple of my exemple. (it works only once because after that I set the end to true) Exemple passing data

mihailpreda avatar Feb 18 '20 20:02 mihailpreda

I believe you can do some similar to this example

In that exemple it is done inside the chatbot component. I need the values outside the chatbot. Here is a exemple of my exemple. (it works only once because after that I set the end to true) Exemple passing data

Hey can you share your Project. I searching exactly this solution for my homework.

Furkan-Oeztuerk avatar Mar 21 '21 00:03 Furkan-Oeztuerk