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

How to navigate to a new page

Open Mohamed-Safan opened this issue 4 years ago • 0 comments

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

Mohamed-Safan avatar Sep 21 '21 03:09 Mohamed-Safan