Communities for your favorite technologies. Explore all Collectives
Stack Overflow for Teams is now called Stack Internal. Bring the best of human thought and AI automation together at your work.
Bring the best of human thought and AI automation together at your work. Learn more
Find centralized, trusted content and collaborate around the technologies you use most.
Stack Internal
Knowledge at work
Bring the best of human thought and AI automation together at your work.
I'm learning React and I got struggle using map function to present data from json file. It do show the loading data before the data load but after that nothing. Print the state.questions in line 6 and do show that there is something in it.
You need the return statement. Or remove the {}
state.questions.map(ques => {return (<p key={ques.id}>{ques.question}</p>) })
Add a comment
What i can see in your console questions is list of dict inside state.questions.
questions
state.questions
{state.questions.questions.map(q => {return (<p key={q.id}>{.question}</p>) })
Required, but never shown
By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.