Proyectos de Subversion LeadersLinked - Antes de SPA

Rev

Rev 467 | Mostrar el archivo completo | | | Autoría | Ultima modificación | Ver Log |

Rev 467 Rev 468
Línea 4... Línea 4...
4
 
4
 
5
    // get props
5
    // get props
Línea 6... Línea 6...
6
    const { option, question } = props;
6
    const { option, question } = props;
7
 
7
 
Línea 8... Línea 8...
8
    // init States 
8
    // init States 
9
    const [checked, setChecked] = useState(question.checked);
9
    const [checked, setChecked] = useState(option.checked);
10
 
-
 
11
    /**
10
 
12
     * Update question answer
11
    /**
13
     * @param {*} option
12
     * Update question answer
14
     */
13
     */
15
    const handleAnswer = () => {
14
    const handleAnswer = () => {
Línea 30... Línea 29...
30
 
29
 
31
    /**
30
    /**
32
     * componentDidMount
31
     * componentDidMount
33
     */
32
     */
34
    useEffect(() => {
33
    useEffect(() => {
35
        setChecked(question.checked);
34
        setChecked(option.checked);
Línea 36... Línea 35...
36
    }, [option]);
35
    }, [option]);
37
 
36