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

Redirect to another page on website using options button

Open AkshraGupta opened this issue 5 years ago • 3 comments

I am having difficulty on how to redirect to another webpage on button click from options in Chatbot. Any help would be appreciated!

AkshraGupta avatar Aug 02 '20 08:08 AkshraGupta

trigger to a custom step from here: https://lucasbassetti.com.br/react-simple-chatbot/#/docs/steps), and use any js function like window.opne(link) or any other function you want. Like:

function GoToPage(){ window.open('https://github.com/', "_blank"); return <p>Go to google</p> }

{ id: '4', options: [ {label: 'opt1', value: '1', trigger: '5'}, {label: 'opt2', value: '2', trigger: '6'} ] },

{ id: '6', component: <GoToPage />, asMessage: true, trigger: '7' },

svipulrao98 avatar Aug 29 '20 12:08 svipulrao98

I am having difficulty on how to redirect to another webpage on button click from options in Chatbot. Any help would be appreciated!

+1 @LucasBassetti redirect the page by clicking on the options

rishinandan08 avatar May 17 '21 09:05 rishinandan08

but after using this code it is redirecting to git page after every click or typing in chatbot.

kjain12 avatar May 23 '21 06:05 kjain12