Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

155
Visualizações
`survey-react` da un error con `this.addEvent`

Heredé un proyecto de reacción y no puedo descifrar cómo usar el módulo survey-react . Sigo recibiendo este error en http://localhost:3000/

 Uncaught TypeError: this.addEvent is not a function node_modules/survey-react/survey.react.js:2582 2579 | * options.newValue - new value. 2580 | */ 2581 | > 2582 | this.onPropertyChanged = this.addEvent(); | ^ 2583 | /** 2584 | * Event that raised on changing property of the ItemValue object. 2585 | * sender - the object that owns the property

Simplifiqué mi proyecto a solo 3 archivos, que son:

Este es mi src/index.js .

 import React from 'react'; import ReactDOM from 'react-dom'; import * as Survey from 'survey-react'; const questions = { elements:[{"type":"comment","name":"If you could enhance one thing about this product, what would it be?","isRequired":true}] }; const srv = Survey.Model(questions); srv.data = {"If you could enhance one thing about this product, what would it be?":"I like it as is, no changes needed."}; ReactDOM.render(<Survey.Survey model={srv} />, document.getElementById('root'));

Este es mi package.json

 { "name": "testingthis", "version": "0.1.0", "private": true, "dependencies": { "babel-jest": "^23.6.0", "react": "^16.6.1", "react-dom": "^16.4.2", "react-scripts": "^2.1.8", "survey-react": "1.9.33" }, "scripts": { "start": "react-scripts start" }, "eslintConfig": { "extends": "react-app" }, "browserslist": [ ">0.2%", "not dead", "not ie <= 11", "not op_mini all" ] }

Este es mi public/index.html

 <!DOCTYPE html> <html lang="en"> <body> <div id="root"></div> </body> </html

¿Qué estoy haciendo mal?

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

No puedo encontrar ninguna documentación sobre el paquete Survey-React, pero los documentos oficiales en el sitio de SurveyJS dicen que debe usar los paquetes Survey -Core y Survey-React - UI ( https://surveyjs.io/Documentation/Library? id=comenzar-reaccionar ):

 import { StylesManager, Model } from "survey-core"; import { Survey } from "survey-react-ui";

Entonces, cambie a esos, o si insiste en usar encuesta-reaccionar , puede hacer que funcione cambiando su código de esta manera:

 import React from "react"; import ReactDOM from "react-dom"; import * as Survey from "survey-react"; const questions = { elements: [ { type: "comment", name: "If you could enhance one thing about this product, what would it be?", isRequired: true } ] }; const data = { "If you could enhance one thing about this product, what would it be?": "I like it as is, no changes needed." } ReactDOM.render(<Survey.Survey json={questions} data={data} />, document.getElementById("root"));
about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda