Dynamically rendering the list from data.json

Solution retrospective
Refactored the application, retrieving data directly from data.json, by fetch("./data.json").
Will do similar in future vanilla JS application.
Please log in to post a comment
Log in with GitHubCommunity feedback
- P@markuslewin
The data file is already hosted together with the other files, though! You can see it at
https://memominguez.github.io/results-summary-component/data.json
.On your computer, you can't fetch the file straight from the disk, so you'll need a tool that provides a dev server, such as Vite or Live Server. With Vite, you can import the JSON file as if it was another JS file:
import json from './data.json'
.Marked as helpful
Join our Discord community
Join thousands of Frontend Mentor community members taking the challenges, sharing resources, helping each other, and chatting about all things front-end!
Join our Discord