score:0

you use the map function in the render() function. like
{ this.props.questions.map((question)=>{
<div id="question">
{question.id} :- {question.text}
<h3>correct answer:- {question.correct}</h3>
<h3>your answer:- {get answer from question id}</h3>
</div>
)}

score:2

try the below render() method with map function:

render() {
    const { questions, useranswer } = this.props;
    return(
        questions.map((question, i)=>
            <div id="question">
            {question.id} :- {question.text}
            <h3>correct answer:- {question.correct}</h3>
            <h3>your answer:- {useranswer[i]}</h3>
            </div>
        )
    )
}

Related Query

More Query from same tag