Skip to content
This repository was archived by the owner on Sep 21, 2019. It is now read-only.

Commit 8b78150

Browse files
author
Mohsen Azimi
committed
Fix readme
1 parent a6c3b9f commit 8b78150

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,15 @@ Transforms React code written in JavaScript to TypeScript.
1515
## Example
1616

1717
**input**
18-
```ts
18+
```jsx
1919
class 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;

0 commit comments

Comments
 (0)