BuilderIO / BuilderIO/mitosis

Mitosis JSX types are not properly mapped

Open
#461 17 comments 3 reactions 0 assignees View on GitHub
bug TypeScript
Dominant language
TypeScript
Stars
14.4k
Forks
671
PR merge metrics
No merged PRs in 30d

Description

Originally from https://github.com/BuilderIO/mitosis/issues/372#issuecomment-1150135164

For this input:
```tsx
import { HTMLAttributes } from "react";

export const headingSizes = [1, 2, 3, 4, 5, 6];

export interface HeadingProps extends HTMLAttributes {
size: typeof headingSizes[number];
}

export default function Heading(props: HeadingProps) {
return


}
```

the output does not preserve the `import { HTMLAttributes } from "react";` import

Contributor guide

Open the contributing guide

Research direction

No source file, test, or entry point is named in the issue. Reproduce the problem with the supplied TSX input, then trace the JSX type-mapping path; done means the generated output preserves the React HTMLAttributes import.

Written by the indexing model from the issue text.

Assessment

Tech stack
react, typescript
Domain
compilers
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.