This repository was archived by the owner on Sep 21, 2019. It is now read-only.
File tree Expand file tree Collapse file tree 11 files changed +99
-70
lines changed
collapse-intersection-interfaces-transform/multiple
end-to-end/multiple-components
react-js-make-props-and-state-transform/multiple-components
react-move-prop-types-to-class-transform/multiple-components
react-remove-prop-types-assignment-transform/multiple
react-remove-prop-types-import
from-react-multi-named-import
react-remove-static-prop-types-member-transform/multiple-components
react-stateless-function-make-props-transform/multiple-components Expand file tree Collapse file tree 11 files changed +99
-70
lines changed Original file line number Diff line number Diff line change 1
1
type Foo = {
2
- foo : string ;
3
- bar : number ;
2
+ foo : string ,
3
+ bar : number
4
4
} ;
5
5
type Bar = {
6
- foo : number ;
7
- bar : string ;
6
+ foo : number ,
7
+ bar : string
8
8
} ;
Original file line number Diff line number Diff line change 1
1
type HelloProps = {
2
- message ?: string ;
2
+ message ?: string
3
3
} ;
4
4
const Hello : React . SFC < HelloProps > = ( { message } ) => {
5
5
return < div > hello { message } </ div > ;
6
6
} ;
7
7
type HeyProps = {
8
- message ?: string ;
8
+ message ?: string
9
9
} ;
10
10
const Hey : React . SFC < HeyProps > = ( { name } ) => {
11
11
return < div > hey, { name } </ div > ;
12
12
} ;
13
13
type MyComponentState = {
14
- foo : number ;
15
- bar : number ;
14
+ foo : number ,
15
+ bar : number
16
16
} ;
17
- export default class MyComponent extends React . Component < {
18
- } , MyComponentState > {
17
+ export default class MyComponent extends React . Component < { } , MyComponentState > {
19
18
render ( ) {
20
- return < button onClick = { this . onclick . bind ( this ) } /> ;
19
+ return < button onClick = { this . onclick . bind ( this ) } /> ;
21
20
}
22
21
onclick ( ) {
23
22
this . setState ( { foo : 1 , bar : 2 } ) ;
24
23
}
25
24
}
26
25
type AnotherComponentProps = {
27
- foo : string ;
26
+ foo : string
28
27
} ;
29
- export class AnotherComponent extends React . Component < AnotherComponentProps , {
30
- } > {
28
+ export class AnotherComponent extends React . Component <
29
+ AnotherComponentProps ,
30
+ { }
31
+ > {
31
32
render ( ) {
32
33
return < div /> ;
33
34
}
Original file line number Diff line number Diff line change 1
1
import * as React from 'react' ;
2
- type MyComponentState = { foo : number ; bar : number ; } ;
3
- export default class MyComponent extends React . Component < {
4
- } , MyComponentState > {
2
+ type MyComponentState = { foo : number , bar : number } ;
3
+ export default class MyComponent extends React . Component < { } , MyComponentState > {
5
4
render ( ) {
6
- return < button onClick = { this . onclick . bind ( this ) } /> ;
5
+ return < button onClick = { this . onclick . bind ( this ) } /> ;
7
6
}
8
7
onclick ( ) {
9
8
this . setState ( { foo : 1 , bar : 2 } ) ;
10
9
}
11
10
}
12
11
type AnotherComponentProps = {
13
- foo : string ;
12
+ foo : string
14
13
} ;
15
- export class AnotherComponent extends React . Component < AnotherComponentProps , {
16
- } > {
14
+ export class AnotherComponent extends React . Component <
15
+ AnotherComponentProps ,
16
+ { }
17
+ > {
17
18
static propTypes = {
18
- foo : React . PropTypes . string . isRequired ,
19
+ foo : React . PropTypes . string . isRequired
19
20
} ;
20
21
render ( ) {
21
22
return < div /> ;
Original file line number Diff line number Diff line change 1
- class SomeComponent extends React . Component < {
2
- foo : number ;
3
- } , {
4
- bar : string ;
5
- } > {
1
+ class SomeComponent extends React . Component <
2
+ {
3
+ foo : number
4
+ } ,
5
+ {
6
+ bar : string
7
+ }
8
+ > {
6
9
static propTypes = { foo : React . PropTypes . string } ;
7
10
render ( ) {
8
11
return null ;
9
12
}
10
13
}
11
14
SomeComponent . propTypes = { foo : React . PropTypes . string } ;
12
15
class AnotherComponent extends React . Component < {
13
- baz : number ;
14
- } > {
16
+ baz : number
17
+ } > {
15
18
static propTypes = { baz : React . PropTypes . string } ;
16
19
render ( ) {
17
20
return null ;
Original file line number Diff line number Diff line change 1
- class SomeComponent extends React . Component < {
2
- foo : string ;
3
- baz : string ;
4
- } , {
5
- bar : string ;
6
- } > {
7
- }
1
+ class SomeComponent extends React . Component <
2
+ {
3
+ foo : string ,
4
+ baz : string
5
+ } ,
6
+ {
7
+ bar : string
8
+ }
9
+ > { }
8
10
class AnotherComponent extends React . Component < {
9
- lol : number ;
10
- } > {
11
- }
11
+ lol : number
12
+ } > { }
Original file line number Diff line number Diff line change 1
- import React from 'react' ;
2
-
1
+ import React from 'react'
3
2
export const Hello = ( { message } ) => {
4
- return < div > hello { message } </ div > ;
5
- } ;
3
+ return < div > hello { message } </ div >
4
+ }
Original file line number Diff line number Diff line change 1
1
import React , { Component } from 'react' ;
2
-
3
2
export class MyComponent extends Component {
4
- render ( ) {
5
- return < div > hello</ div > ;
6
- }
3
+ render ( ) {
4
+ return < div > hello</ div > ;
5
+ }
7
6
}
Original file line number Diff line number Diff line change 1
- import React from 'react' ;
2
-
1
+ import React from 'react'
3
2
export const Hello = ( { message } ) => {
4
- return < div > hello { message } </ div > ;
5
- } ;
3
+ return < div > hello { message } </ div >
4
+ }
Original file line number Diff line number Diff line change 1
- class SomeComponent extends React . Component < {
2
- foo : number ;
3
- } , {
4
- bar : string ;
5
- } > {
6
- }
7
- class AnotherComponent extends React . Component < {
8
- foo : number ;
9
- } , {
10
- bar : string ;
11
- } > {
12
- }
1
+ class SomeComponent extends React . Component <
2
+ {
3
+ foo : number
4
+ } ,
5
+ {
6
+ bar : string
7
+ }
8
+ > { }
9
+ class AnotherComponent extends React . Component <
10
+ {
11
+ foo : number
12
+ } ,
13
+ {
14
+ bar : string
15
+ }
16
+ > { }
Original file line number Diff line number Diff line change 1
1
type HelloProps = {
2
- message ?: string ;
2
+ message ?: string
3
3
} ;
4
4
const Hello : React . SFC < HelloProps > = ( { message } ) => {
5
- return < div > hello { message } </ div > ;
5
+ return < div > hello { message } </ div > ;
6
6
} ;
7
7
type HeyProps = {
8
- name : string ;
8
+ name : string
9
9
} ;
10
10
const Hey : React . SFC < HeyProps > = ( { name } ) => {
11
- return < div > hey, { name } </ div > ;
11
+ return < div > hey, { name } </ div > ;
12
12
} ;
13
13
Hey . propTypes = {
14
- name : React . PropTypes . string . isRequired ,
14
+ name : React . PropTypes . string . isRequired
15
15
} ;
16
16
Hello . propTypes = {
17
- message : React . PropTypes . string ,
17
+ message : React . PropTypes . string
18
18
} ;
You can’t perform that action at this time.
0 commit comments