From the course: React.js: Building an Interface

Unlock the full course today

Join today to access over 22,600 courses taught by industry experts or purchase this course individually.

Importing JSON data as a variable

Importing JSON data as a variable - React.js Tutorial

From the course: React.js: Building an Interface

Start my 1-month free trial

Importing JSON data as a variable

- It's time to start adding some appointments. So, I've prepared a bit of data here for you, at this URL so that we can go ahead and grab this and work with it. So, I'm going to go and select all this and I'm going to place it in this source folder. So, if I insert a file here, I'm going to call it data.JSON and I paste all of my JSON code in there. Then we can easily import that into App.JS just by adding an import statement. And when we import it, we want it to have a variable name. So, that will be appointmentList. And it's going to be imported from data.JSON. So, it's in the same folder as the current file. So, I'm going to save that. And then, once we have this information, then we can go ahead and add our list of items. So, we're going to create an unordered list. And this unordered list, I'm going to add some code here for Tailwind CSS. So, this is going to have a class name and it's going to say, divide,…

Contents