Using component types

import Text from "@kiwicom/orbit-components/lib/Text";
interface Props {
type: string;
}
const WrappedText = ({ children, type }) => <Text type={type}>{children}</Text>;
export default WrappedText;

Typescript

import Text, { Props as TextProps } from "@kiwicom/orbit-components/lib/Text";
interface Props {
type: TextProps["type"];
}
const WrappedText = ({ children, type }) => <Text type={type}>{children}</Text>;
export default WrappedText;

Flow

import Text from "@kiwicom/orbit-components/lib/Text";
import type { Props as TextProps } from "@kiwicom/orbit-components/lib/Text";
type Props = {|
type: $PropertyType<TextProps, "type">,
|};
const WrappedText = ({ children, type }) => <Text type={type}>{children}</Text>;
export default WrappedText;