Answer the question
In order to leave comments, you need to log in
How to display products from json in React?
Hello! tell me, please, how to implement this: The catalog of all products should be taken from a json file
Thank you
Answer the question
In order to leave comments, you need to log in
For example like this:
import React from 'react';
import data from './products.json';
const List = () => (
<ul>
{data.map(product => (
<li key={product.id}>{product.title}</li>
)}
</ul>
);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question