Improve extract meta#3895
Conversation
|
|
This is a huge improvement! It's now possible to see which component/prop is generating the error: Here's an example: However, this isn't something I can fix in the component. In this case, the It looks like the parser is recursing into React.ComponentProps<'circle'>, eventually reaching dangerouslySetInnerHTML.__html. Would it make sense to skip the React DOM types? As a workaround, I can get the component to build by using prop type |
Not for this case, it trigger the error of named Otherwise, there is always typescript type OmitHtmlMerge<
HtmlTag extends keyof React.JSX.IntrinsicElements,
Params extends keyof React.ComponentProps<HtmlTag> = never,
> = Omit<React.ComponentProps<HtmlTag>, "dangerouslySetInnerHTML" | Params>;
// No extra keys omitted — Params defaults to never
type Cleaned = OmitHtmlMerge<"circle">;
// Also omit some real props of <circle>
type Cleaned2 = OmitHtmlMerge<"circle", "onClick" | "cx">; |



Improve extract-meta errors by include file/propPath/line where the error originates.
Restart of #3364, fixes #3362