Skip to content

Instantly share code, notes, and snippets.

@jaroslav-kubicek
Created November 22, 2019 23:49
Show Gist options
  • Save jaroslav-kubicek/2002b1da799a4021a67e6c046c1f0b8a to your computer and use it in GitHub Desktop.
Save jaroslav-kubicek/2002b1da799a4021a67e6c046c1f0b8a to your computer and use it in GitHub Desktop.
/* @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