type Props = {
foo: string;
};
const MyComponent: React.FunctionComponent<Props> = props => {
return <span>{props.foo}</span>;
};
<MyComponent foo="bar" />;
来源: https://jkchao.github.io/typescript-book-chinese/jsx/reactJSX.html#html-标签
=================
问题1: <Props>
是不是定义了这个组件MyComponent 将要接受的props参数个数,以及每个参数的类型?
问题2: React.FunctionComponent 是不是组件 MyComponent的返回值类型?
谢谢