받는 컴포넌트
interface PropsType { list: Array<string>; } const App = (props: PropsType) => { return( {props.list.map((list: string, index: number) => ( <li key={index}>{list}</li> ))} )
또는
type appProps = { list:string; } const App = ({list}: appProps) => {}
또는
const App = (list: string) => {}
배열로 받을 때
list: { title: string; url: string }[];
interface propsType {
buttonText: string;
big?: boolean;
onClick?: React.MouseEventHandler<HTMLButtonElement>;
type?: 'submit' | 'button' | 'reset';
}
const Button = (props: propsType) => {
//props.big 으로 사용
}