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.
1515## Example
1616
1717** input**
18- ``` ts
18+ ``` jsx
1919class MyComponent extends React .Component {
2020 static propTypes = {
21- p : React .PropTypes .string .isRequired ,
22- r : React .PropTypes .number
21+ prop1 : React .PropTypes .string .isRequired ,
22+ prop2 : React .PropTypes .number
2323 }
2424 constructor () {
2525 super ();
26- this .state = { foo: 1 , bar: 2 };
26+ this .state = { foo: 1 , bar: ' str ' };
2727 }
2828 render () {
2929 return < div> {this .state .foo }, {this .state .bar }, {this .state .baz }< / div>
@@ -35,13 +35,13 @@ class MyComponent extends React.Component {
3535```
3636
3737** 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 ;
4242}
4343
44- interface MyComponentState {
44+ type MyComponentState = {
4545 foo: number ;
4646 bar: string ;
4747 baz: number | undefined ;
You can’t perform that action at this time.
0 commit comments