File tree Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Expand file tree Collapse file tree 1 file changed +9
-9
lines changed Original file line number Diff line number Diff line change @@ -15,15 +15,15 @@ Transforms React code written in JavaScript to TypeScript.
15
15
## Example
16
16
17
17
** input**
18
- ``` ts
18
+ ``` jsx
19
19
class MyComponent extends React .Component {
20
20
static propTypes = {
21
- p : React .PropTypes .string .isRequired ,
22
- r : React .PropTypes .number
21
+ prop1 : React .PropTypes .string .isRequired ,
22
+ prop2 : React .PropTypes .number
23
23
}
24
24
constructor () {
25
25
super ();
26
- this .state = { foo: 1 , bar: 2 };
26
+ this .state = { foo: 1 , bar: ' str ' };
27
27
}
28
28
render () {
29
29
return < div> {this .state .foo }, {this .state .bar }, {this .state .baz }< / div>
@@ -35,13 +35,13 @@ class MyComponent extends React.Component {
35
35
```
36
36
37
37
** output**
38
- ``` ts
39
- interface MyComponentProps {
40
- p : string ;
41
- r : number | undefined ;
38
+ ``` tsx
39
+ type MyComponentProps = {
40
+ prop1 : string ;
41
+ prop2 : number | undefined ;
42
42
}
43
43
44
- interface MyComponentState {
44
+ type MyComponentState = {
45
45
foo: number ;
46
46
bar: string ;
47
47
baz: number | undefined ;
You can’t perform that action at this time.
0 commit comments