Skip to content

With Typescript Omit Union types get lost #882

Open
@bmsuseluda

Description

@bmsuseluda

Hello together,

with the following code the union type of name gets lost:

interface FullProps {
  /** The name to greet */
  name: "world" | "hello";
  title: string;
}

type Props = Omit<FullProps, "title">

/**
 * Hello world component
 */
const MyComponent = ({name = 'world'}: Props) => {
  return <div />;
}

I have similar problems with Extract and Pick.

Is it possible to support these typescript function?

Thanks in regards

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions