survey-creator
survey-creator copied to clipboard
add custom widget
how add new custom widget with react.js?

import { SurveyCreator } from 'survey-creator-react'
// . how use SurveyCreator to add new widget
// . SurveyCreator => CustomWidgetCollection.Instance.add(widget, type)
const surveyCreatorMemo = useMemo(() => {
localization.currentLocale = lang
const surveyCreator = new SurveyCreator(options)
surveyCreator.JSON = survey ? JSON.parse(survey) : {}
surveyCreator.showSidebar = false
surveyCreator.toolbox.changeCategories(categories)
surveyCreator.toolbarItems.splice(0, 3)
surveyCreator.addPluginTab(
'questionBankTab',
questionBankTab,
t('common:toolbar.admin.questionBank'),
'svc-tab-template',
1
)
surveyCreator.allowEditSurveyTitle = false
surveyCreator.CustomWidgetCollection.Instance.add({}, "") // wrong
return surveyCreator
}, [options, lang])
please, help me!