react-simple-chatbot
react-simple-chatbot copied to clipboard
Use steps in custom component
Hi, how can I use steps to pass previous step value to a custom component?
*example of what I tried but it said the definition of steps is missing { id: "1”, component: <thisComponent value=(steps[previousStep.id].value) />, WaitAction:true }
Hi @keren-or-b. Let's say you have a step to get the user name and it's called getUserName. You can access the value this way:
const CustomComponent = ({ steps }) => {
return <div>steps.getUserName.value</div>;
};