Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support method parameters in TypeScript
- Loading branch information
1 parent
4cb1f3b
commit f2193db
Showing
3 changed files
with
76 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/** | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
* | ||
*/ | ||
|
||
import React, { Component } from 'react'; | ||
|
||
interface Props { | ||
foo: string | ||
} | ||
|
||
/** | ||
* This is a typescript class component | ||
*/ | ||
export default class TSComponent extends Component<Props> { | ||
render() { | ||
return <h1>Hello world</h1>; | ||
} | ||
|
||
/** | ||
* This is a method | ||
*/ | ||
method(a: string): string { | ||
return a; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters