File tree Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Original file line number Diff line number Diff line change 1
1
import React , { Component } from 'react' ;
2
2
3
- function capitalize ( str ) {
4
- return str . substr ( 0 , 1 ) . toUpperCase ( ) + str . substr ( 1 ) ;
5
- }
6
-
7
3
class Form extends Component {
8
4
state = {
9
5
user : Object . assign ( { } , this . props . user )
@@ -32,10 +28,10 @@ class Form extends Component {
32
28
) ;
33
29
}
34
30
35
- renderField = ( state , name , label = capitalize ( name ) ) => {
31
+ renderField = ( state , name , label = name ) => {
36
32
return (
37
33
< div style = { { marginBottom : '12px' } } >
38
- < label >
34
+ < label style = { { textTransform : 'capitalize' } } >
39
35
{ label }
40
36
< input
41
37
type = "text"
Original file line number Diff line number Diff line change 1
1
import React , { Component } from 'react' ;
2
2
3
- function capitalize ( str ) {
4
- return str . substr ( 0 , 1 ) . toUpperCase ( ) + str . substr ( 1 ) ;
5
- }
6
-
7
3
class Form extends Component {
8
4
state = {
9
5
user : Object . assign ( { } , this . props . user )
@@ -32,10 +28,10 @@ class Form extends Component {
32
28
) ;
33
29
}
34
30
35
- renderField = ( state , name , label = capitalize ( name ) ) => {
31
+ renderField = ( state , name , label = name ) => {
36
32
return (
37
33
< div style = { { marginBottom : '12px' } } >
38
- < label >
34
+ < label style = { { textTransform : 'capitalize' } } >
39
35
{ label }
40
36
< input
41
37
type = "text"
You can’t perform that action at this time.
0 commit comments