Created
November 22, 2019 23:49
-
-
Save jaroslav-kubicek/2002b1da799a4021a67e6c046c1f0b8a to your computer and use it in GitHub Desktop.
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
/* @flow */ | |
import * as React from "react" | |
type Sex = "MALE" | "FEMALE" | "UNDEFINED" | |
type Props = $ReadOnly<{| | |
name: string, | |
sex: Sex, | |
address: ?React.Node, | |
|}>; | |
const Person = (props: Props) => { | |
return ( | |
<div> | |
<div>{props.name} is {props.sex.toLowerCase()}</div> | |
{props.address} | |
</div> | |
); | |
}; | |
const App = () => (<Person name="Jarda" sex="MALE" address={<div>Address: Prague</div>} />); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment