Props Tipleri
type PropTypes = {
children?: JSX.Element
name?: 'ahmet' | "fatih";
surname?: string;
key?: string
}
const Character = (props: CharacterPropTypes) => {
const {name, surname, children} = props;
return (
<div>
<h1>{`${name} ${surname}`}</h1>
{children}
</div>
);
};const Character:React.FC<CharacterPropTypes> = (props) => {
const {name, surname, children} = props;
return (
<div>
<h1>{`${name} ${surname}`}</h1>
{children}
</div>
);
};Last updated