From the course: Building React and ASP.NET Core Applications
Unlock the full course today
Join today to access over 22,600 courses taught by industry experts or purchase this course individually.
Designing the Create page
From the course: Building React and ASP.NET Core Applications
Designing the Create page
- [Instructor] Now, let's create a new component which we are going to use to add new trips to our trips list. For that, let's go to visual code. In here, go inside the ClientApp, then Source, Components, Trip. In here, create a new file named Create.jsx. To create a component, we need to import the React and the Component from React library. Then next, we'll just write in here export class, create, which extends the component base class. In here, let us create a constructor where we are going to pass the parameter props, then, we'll just write in here, super(props). Now, for the create view we are going to have a form where we will have four fields. We are going to use these fields to send an object to our API end point. So, let us create the initial state of these fields. For that, we just write this.state, and then this is equal to, this state will have a name property, which is defaulted to just an empty string,…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
-
React key concepts3m 5s
-
(Locked)
Designing the Trips page10m 47s
-
(Locked)
Reading data from React10m 45s
-
(Locked)
Designing the Create page6m 4s
-
(Locked)
Adding new data from React9m 48s
-
(Locked)
Challenge: Updating data from React49s
-
(Locked)
Solution: Updating data from React14m 36s
-
(Locked)
Deleting data from React10m 11s
-
(Locked)
Handling errors in React6m 26s
-
-
-
-