import { Base , Question , SurveyError , SurveyModel } from "survey-core" ; import { ISurveyCreator , ReactElementFactory , ReactQuestionFactory , SurveyQuestion } from "survey-react-ui" ; import { CreatorBase } from "@survey/creator" ; import React from "react" ; interface IQuestionEditorContentComponentProps { creator : CreatorBase < SurveyModel > ; survey : SurveyModel ; } export class QuestionEditorContentComponent extends React . Component < IQuestionEditorContentComponentProps , any > implements ISurveyCreator { constructor ( props ) { super ( props ) ; } get survey ( ) { return this . props . survey ; } public createQuestionElement ( question ) { return ReactQuestionFactory . Instance . createQuestion ( ! question . isDefaultRendering || question . isDefaultRendering ( ) ? question . getTemplate ( ) : question . getComponentName ( ) , { question : question , isDisplayMode : question . isInputReadOnly , creator : this , } ) ; } public questionTitleLocation ( ) { return this . survey . questionTitleLocation ; } public questionErrorLocation ( ) { return this . survey . questionErrorLocation ; } renderError ( key , error , cssClasses ) { return null ; } render ( ) { const question = this . survey . getAllQuestions ( ) [ 0 ] ; return ( < > < SurveyQuestion creator = { this } element = { question } > < /SurveyQuestion> < />); } } ReactElementFactory . Instance . registerElement ( "svc-question-editor-content" , ( props ) => { return React . createElement ( QuestionEditorContentComponent , props ) ; } ) ;