-
-
Notifications
You must be signed in to change notification settings - Fork 300
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
ec9e09c
commit ea424ae
Showing
14 changed files
with
1,145 additions
and
17 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,32 @@ | ||
/** | ||
* 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'; | ||
|
||
type BaseProps = { | ||
/** Optional prop */ | ||
foo?: string, | ||
/** Required prop */ | ||
bar: number | ||
}; | ||
|
||
type TransitionDuration = number | { enter?: number, exit?: number } | 'auto'; | ||
|
||
type Props = BaseProps & { | ||
/** Complex union prop */ | ||
baz: TransitionDuration | ||
} | ||
|
||
/** | ||
* This is a typescript class component | ||
*/ | ||
export default class TSComponent extends Component<Props> { | ||
render() { | ||
return <h1>Hello world</h1>; | ||
} | ||
} |
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,16 @@ | ||
import React from 'react'; | ||
|
||
type Props = { | ||
align?: "left" | "center" | "right" | "justify", | ||
left?: boolean, | ||
center?: boolean, | ||
right?: boolean, | ||
justify?: boolean, | ||
}; | ||
|
||
/** | ||
* This is a TypeScript function component | ||
*/ | ||
export function TSFunctionComponent(props: Props) { | ||
return <h1>Hello world</h1>; | ||
} |
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
Oops, something went wrong.