Skip to content

Is it possible to pass an argument to submitCallback? #460

@diego-v

Description

@diego-v

In have this code

        cf = ConversationalForm.startTheConversation({
            options: {
                theme: 'green',
                submitCallback: submitCallback,
                preventAutoFocus: true,
            },
            tags: tags,
        });
        ref.current.appendChild(cf.el);
        return function unMount() {
            cf.remove();
        };
    }, []);

I would like to pass an argument to submitCallback in order to use it in the function:

function submitCallback(uniqueId) {
        var formData = cf.getFormData(true);
        cf.addRobotChatResponse("Listo!")
        actions.updateCompanyAction({
            id: uniqueId,
            name: formData.name,
            country: formData.country,
            sites: formData.sites
        });
    }

Is that possible?

Thanks!

Great library by the way...!

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions