File tree Expand file tree Collapse file tree 18 files changed +54
-54
lines changed
Finished App/src/components Expand file tree Collapse file tree 18 files changed +54
-54
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ class StorePicker extends React.Component {
8
8
// 1. Stop the form from submitting
9
9
event . preventDefault ( ) ;
10
10
// 2. get the text from that input
11
- const storeName = this . myInput . value . value ;
11
+ const storeName = this . myInput . current . value ;
12
12
// 3. Change the page to /store/whatever-they-entered
13
13
this . props . history . push ( `/store/${ storeName } ` ) ;
14
14
} ;
Original file line number Diff line number Diff line change @@ -11,11 +11,11 @@ class AddFishForm extends React.Component {
11
11
// 1. stop the form from submitting
12
12
event . preventDefault ( ) ;
13
13
const fish = {
14
- name : this . nameRef . value . value ,
15
- price : parseFloat ( this . priceRef . value . value ) ,
16
- status : this . statusRef . value . value ,
17
- desc : this . descRef . value . value ,
18
- image : this . imageRef . value . value
14
+ name : this . nameRef . current . value ,
15
+ price : parseFloat ( this . priceRef . current . value ) ,
16
+ status : this . statusRef . current . value ,
17
+ desc : this . descRef . current . value ,
18
+ image : this . imageRef . current . value
19
19
} ;
20
20
this . props . addFish ( fish ) ;
21
21
// refresh the form
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ class StorePicker extends React.Component {
8
8
// 1. Stop the form from submitting
9
9
event . preventDefault ( ) ;
10
10
// 2. get the text from that input
11
- const storeName = this . myInput . value . value ;
11
+ const storeName = this . myInput . current . value ;
12
12
// 3. Change the page to /store/whatever-they-entered
13
13
this . props . history . push ( `/store/${ storeName } ` ) ;
14
14
} ;
Original file line number Diff line number Diff line change @@ -11,11 +11,11 @@ class AddFishForm extends React.Component {
11
11
// 1. stop the form from submitting
12
12
event . preventDefault ( ) ;
13
13
const fish = {
14
- name : this . nameRef . value . value ,
15
- price : parseFloat ( this . priceRef . value . value ) ,
16
- status : this . statusRef . value . value ,
17
- desc : this . descRef . value . value ,
18
- image : this . imageRef . value . value
14
+ name : this . nameRef . current . value ,
15
+ price : parseFloat ( this . priceRef . current . value ) ,
16
+ status : this . statusRef . current . value ,
17
+ desc : this . descRef . current . value ,
18
+ image : this . imageRef . current . value
19
19
} ;
20
20
this . props . addFish ( fish ) ;
21
21
// refresh the form
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ class StorePicker extends React.Component {
8
8
// 1. Stop the form from submitting
9
9
event . preventDefault ( ) ;
10
10
// 2. get the text from that input
11
- const storeName = this . myInput . value . value ;
11
+ const storeName = this . myInput . current . value ;
12
12
// 3. Change the page to /store/whatever-they-entered
13
13
this . props . history . push ( `/store/${ storeName } ` ) ;
14
14
} ;
Original file line number Diff line number Diff line change @@ -11,11 +11,11 @@ class AddFishForm extends React.Component {
11
11
// 1. stop the form from submitting
12
12
event . preventDefault ( ) ;
13
13
const fish = {
14
- name : this . nameRef . value . value ,
15
- price : parseFloat ( this . priceRef . value . value ) ,
16
- status : this . statusRef . value . value ,
17
- desc : this . descRef . value . value ,
18
- image : this . imageRef . value . value
14
+ name : this . nameRef . current . value ,
15
+ price : parseFloat ( this . priceRef . current . value ) ,
16
+ status : this . statusRef . current . value ,
17
+ desc : this . descRef . current . value ,
18
+ image : this . imageRef . current . value
19
19
} ;
20
20
this . props . addFish ( fish ) ;
21
21
// refresh the form
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ class StorePicker extends React.Component {
8
8
// 1. Stop the form from submitting
9
9
event . preventDefault ( ) ;
10
10
// 2. get the text from that input
11
- const storeName = this . myInput . value . value ;
11
+ const storeName = this . myInput . current . value ;
12
12
// 3. Change the page to /store/whatever-they-entered
13
13
this . props . history . push ( `/store/${ storeName } ` ) ;
14
14
} ;
Original file line number Diff line number Diff line change @@ -11,11 +11,11 @@ class AddFishForm extends React.Component {
11
11
// 1. stop the form from submitting
12
12
event . preventDefault ( ) ;
13
13
const fish = {
14
- name : this . nameRef . value . value ,
15
- price : parseFloat ( this . priceRef . value . value ) ,
16
- status : this . statusRef . value . value ,
17
- desc : this . descRef . value . value ,
18
- image : this . imageRef . value . value
14
+ name : this . nameRef . current . value ,
15
+ price : parseFloat ( this . priceRef . current . value ) ,
16
+ status : this . statusRef . current . value ,
17
+ desc : this . descRef . current . value ,
18
+ image : this . imageRef . current . value
19
19
} ;
20
20
this . props . addFish ( fish ) ;
21
21
// refresh the form
Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ class StorePicker extends React.Component {
8
8
// 1. Stop the form from submitting
9
9
event . preventDefault ( ) ;
10
10
// 2. get the text from that input
11
- const storeName = this . myInput . value . value ;
11
+ const storeName = this . myInput . current . value ;
12
12
// 3. Change the page to /store/whatever-they-entered
13
13
this . props . history . push ( `/store/${ storeName } ` ) ;
14
14
} ;
Original file line number Diff line number Diff line change @@ -11,11 +11,11 @@ class AddFishForm extends React.Component {
11
11
// 1. stop the form from submitting
12
12
event . preventDefault ( ) ;
13
13
const fish = {
14
- name : this . nameRef . value . value ,
15
- price : parseFloat ( this . priceRef . value . value ) ,
16
- status : this . statusRef . value . value ,
17
- desc : this . descRef . value . value ,
18
- image : this . imageRef . value . value
14
+ name : this . nameRef . current . value ,
15
+ price : parseFloat ( this . priceRef . current . value ) ,
16
+ status : this . statusRef . current . value ,
17
+ desc : this . descRef . current . value ,
18
+ image : this . imageRef . current . value
19
19
} ;
20
20
this . props . addFish ( fish ) ;
21
21
// refresh the form
You can’t perform that action at this time.
0 commit comments