ReactElement
- type
- props
- className
- children
ReactNode
- ReactChild
- ReactFragment
- ReactPortal
- boolean
- null
- undefined
interface IconProps {
size: number;
}
interface Props {
icon: React.ReactElement<IconProps>;
}
const Item = ({ icon }: Props) => {
const iconsize = icon.props.size;
};
// 이렇게도 쓸 수 있다.
type ReactSelectProps = React.ComponentPropsWithoutRef<"select">;
interface SelectProps<OptionType extends Record<string, string>> {
id?: ReactSelectProps["id"];
className?: ReactSelectProps["className"];
}