Created
August 22, 2017 15:17
-
-
Save joakin/126823ce9a49b3838cb0169dfeb84e95 to your computer and use it in GitHub Desktop.
What to type
This file contains hidden or 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
// --- 1 | |
const app: FunctionalComponent<any> = (_props: any):JSX.Element => | |
<div class="App">Hello world</div>; | |
export default app | |
// --- 2 | |
const app: FunctionalComponent<any> = () => | |
<div class="App">Hello world</div>; | |
export default app | |
// --- 3 | |
export default (_props: any): JSX.Element => | |
<div class="App">Hello world</div>; | |
// --- 4 | |
export default () => | |
<div class="App">Hello world</div>; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This typechecks correctly ✅
This doesn't type check ❌
This does type check ✅
This doesn't type check ❌