Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 443 | Rev 453 | Ir a la última revisión | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 443 Rev 452
Línea 1... Línea 1...
1
import React from "react";
1
import React, { useState } from "react";
2
import Option from "../option/Option";
2
import Option from "../option/Option";
Línea 3... Línea 3...
3
 
3
 
Línea -... Línea 4...
-
 
4
const Question = (props) => {
-
 
5
 
-
 
6
 
4
const Question = (props) => {
7
 
5
 
8
 
-
 
9
    // get props
Línea 6... Línea 10...
6
    // get props
10
    const { question, backendVars, handleAnswer } = props;
7
    const { question, backendVars, handleAnswer } = props;
11
    const [input] = useState(question.value); 
8
 
12
 
9
    return (
13
    return (
Línea 19... Línea 23...
19
                <div className="form-group">
23
                <div className="form-group">
20
                    {question.multiline == 1 ? (
24
                    {question.multiline == 1 ? (
21
                        <textarea
25
                        <textarea
22
                            className="form-control"
26
                            className="form-control"
23
                            rows="5"
27
                            rows="5"
24
                            value={question.answer}
28
                            value={input}
25
                            maxLength={question.maxlength}
29
                            maxLength={question.maxlength}
26
                            name={question.slug_question}
30
                            name={question.slug_question}
27
                            onChange={e =>
31
                            onChange={e =>
28
                                handleAnswer(question.slug_section, question.slug_question, e.target.value)
32
                                handleAnswer(question.slug_section, question.slug_question, e.target.value)
29
                            }
33
                            }