使用 Flow 来检查 prop 状态的无状态功能组件
type Props = {
posts: Array<Article>,
dispatch: Function,
children: ReactElement
}
const AppContainer =
({ posts, dispatch, children }: Props) => (
<div className="main-app">
<Header {...{ posts, dispatch }} />
{children}
</div>
)