I'm a new developer and I need help to display this json data on the website using map function.
This is what json data look like:
https://fortnite-api.theapinetwork.com/store/get
and this is what my code looks like right now:
export default function App() {
const [items, setItems] = useState('');
useEffect(() => {
const url = 'https://fortnite-api.theapinetwork.com/store/get';
const fetchData = async () => {
try {
const response = await fetch(url);
const json = await response.json();
console.log(json.data);
setItems(json.data);
} catch (error) {
console.log('error', error);
}
};
fetchData();
}, []);
console.log(items)
return (
<div>
<center>
<h1>Virtual Fortnite Store</h1>
</center>
</div>
);
}
I want to display all of the item's:
- name
- image
- type
- rarity
- description
Thank You