You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Custom Component with triggerNextStep ends up in loop #202
I use a custom component as step and in that custom component i use triggerNextStep. This makes the ChatBOt end up in an infinite loop
I have a custom step::
{
id: 'fe_tag',
component: ,
replace: false,
waitAction: true,
asMessage: true,
},
And I have inside FeTag component
this.props.triggerNextStep({trigger: val});
However now my ChatBot ends up in a loop. This seems only to happen if I use the props replace: false. With replace: true it seems ok.
However I want to show the output of the component FeTag depending on the user choise, xo I need replace to be false.
Am I overlooking something or how to use this.props.triggerNextStep({trigger: val}); inside a custom component?
This is fixed in #392: each step now triggers the next one only once and clears its timer when it unmounts. React 18 StrictMode mounted every step twice, which doubled the messages at each step, and custom components calling triggerNextStep more than once (or double clicks on options) had the same effect.
It will be part of the next release. Closing, thanks for reporting!
Activity
pascalgagneur commentedon Oct 4, 2019
What is the value of 'val'
Could you post an example?
LucasBassetti commentedon Sep 26, 2026
This is fixed in #392: each step now triggers the next one only once and clears its timer when it unmounts. React 18
StrictModemounted every step twice, which doubled the messages at each step, and custom components callingtriggerNextStepmore than once (or double clicks on options) had the same effect.It will be part of the next release. Closing, thanks for reporting!