yoavbls / pretty-ts-errors

🔵 Make TypeScript errors prettier and human-readable in VSCode 🎀
https://marketplace.visualstudio.com/items?itemName=yoavbls.pretty-ts-errors
MIT License
13.14k stars 89 forks source link

Props in React Component #65

Closed myagizmaktav closed 10 months ago

myagizmaktav commented 1 year ago

Describe the bug When writing code in React, I often need to transfer props to the parent component. However, I sometimes forget which props need to be omitted when passing them to the parent component.

Expected behavior I expect to have a clear and convenient way of determining which props should be omitted when passing them to the parent component.

LanguagePicker.tsx

type languagePickerProps = {
  pickerProps?: DropDownPickerProps<Object>;

  // Omit<
  //   DropDownPickerProps<Object>,
  //   "multiple" | "setValue" | "value" | "items" | "open" | "setOpen"
  // >;
};

export const LanguagePicker = (props: languagePickerProps) => {
  // Component logic here
};

Footer.tsx

<LanguagePicker
  pickerProps={{
    style: {
      backgroundColor: "red",
    },
  }}
/>

Screenshots

Props needs to be shown in code format I think.

Please provide more context or additional information if necessary to help identify and resolve the issue.

yoavbls commented 10 months ago

Fixed in 0.5.2 🙂