1
00:00:00,050 --> 00:00:00,560
All right.

2
00:00:00,980 --> 00:00:06,310
I guess the first functionality we'll start working on is going to be the register.

3
00:00:06,320 --> 00:00:11,300
So I want to have the option for user to register.

4
00:00:11,660 --> 00:00:19,790
And before we start setting up any code, let's just go over the typical setup because in the following

5
00:00:19,790 --> 00:00:23,510
videos we'll use React router actions instead.

6
00:00:23,690 --> 00:00:32,780
So let's say you have a React application and if you want to submit the form and send the request when

7
00:00:32,780 --> 00:00:39,650
the form is submitted, most likely this is going to be your approach where essentially you will have

8
00:00:39,650 --> 00:00:42,800
the form element in there, you'll add on submit.

9
00:00:42,800 --> 00:00:48,500
So you'll be listening for submit events and you'll pass in the callback function.

10
00:00:48,500 --> 00:00:54,350
Now in the callback function, the first thing you want to do is to prevent the default and then set

11
00:00:54,350 --> 00:00:56,150
up the request again.

12
00:00:56,150 --> 00:01:00,030
I'm using Axios, but of course you can fetch and all that.

13
00:01:00,030 --> 00:01:02,640
So in here we just set it equal to some kind of data.

14
00:01:02,670 --> 00:01:09,540
Go with await then Axios dot post and let's imagine that I'm using controlled input scenario.

15
00:01:09,660 --> 00:01:16,080
I just go with the URL here and then I pass in the value and all of this is nice, but this is not the

16
00:01:16,080 --> 00:01:18,960
approach we're going to use in this project.

17
00:01:18,990 --> 00:01:23,610
You see in the latest React router Dom version.

18
00:01:24,280 --> 00:01:31,660
There's something called actions which allows us to handle form submissions in a more elegant way.

19
00:01:31,690 --> 00:01:37,270
Now, please keep in mind that we'll have quite a few actions throughout the project.

20
00:01:37,360 --> 00:01:41,680
And of course for the first one we'll take it nice and slow.

21
00:01:41,680 --> 00:01:43,870
So I'll do everything step by step.

22
00:01:43,870 --> 00:01:47,170
So don't get discouraged if it just takes a little bit of time.

23
00:01:47,170 --> 00:01:52,510
I just want to make sure that we're all on the same page and once we're done with our first action,

24
00:01:52,510 --> 00:01:55,270
completely in the register page.

25
00:01:55,930 --> 00:02:02,080
Of course the next actions will set up in the login in Add job are going to be much quicker because

26
00:02:02,080 --> 00:02:07,660
we are already going to be familiar with the syntax, the code as well as the gotchas.

27
00:02:07,660 --> 00:02:12,520
And once we're clear on that, Up next, let's start working on the register page.

