— Typescript — 1 min read
1const MyObject = {2 key: "key",3 name: "name",4};56interface ChildProps {7 type: keyof typeof MyObject;8}910const Child = ({ type }: ChildProps) => {11 return <div>type: {type}</div>;12};1314const Parent = () => {15 return <Child type="name" />;16};