LucasBassetti / react-simple-chatbot

:speech_balloon: Easy way to create conversation chats
https://lucasbassetti.com.br/react-simple-chatbot/
MIT License
1.72k stars 596 forks source link

How to navigate to a new page #317

Open Mohamed-Safan opened 2 years ago

Mohamed-Safan commented 2 years ago

hi @LucasBassetti

I have been trying to create a react-based chatbot, in that if a user presses an option/button from the chatbot I want to display a component outside of the chatbot and on the same page.

this is my sample chatbot Code :


 {
              id: "summary-end-graph",
              asMessage: false,

              component: <Calculators/>,

              trigger: "summary-ends-last",
              waitAction : true,
              delay: 1300,

            },

I have mentioned here as Calculators is a different component

Sample code of the Calculators component

class Calculators extends Component {
  constructor(props) {
    super(props);  
    const { steps } = this.props;
    const { salaryanswer, rate } = steps;
................

When the user clicks on an option inside the chatbot, the calculators component should come out of the chatbot. How can I do this