From the course: Building Full-Stack Apps with React and Spring

Unlock the full course today

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

Finalize list of contacts component

Finalize list of contacts component

From the course: Building Full-Stack Apps with React and Spring

Start my 1-month free trial

Finalize list of contacts component

- [Instructor] Now we'll finalize our listing by connecting to our server in our contact file. So the first thing we're going to do is import two files that we're going to create in the following video. So let's go ahead and do that while we're working on this specific file here. So we're going to create a file called SingleContact from SingleContact, so it's not there yet, and then we'll also import AddContacts, which is going to be our form that we'll create shortly to AddContacts. So we already have our state created here so we're good there. So what we need to do now is do a component did mount, which is basically the method that runs before it renders our component here. So what we're going to do is create that right away. So component did mount, and what this method is going to allow us is to fetch the data before we actually render our component here. So basically we'll have access to the data with the fetch method here. So basically we're fetching from our server. So if you…

Contents