Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: treat jsx expr tag names as components #258

Merged
merged 1 commit into from
Jun 24, 2024

Conversation

marvinhagemeister
Copy link
Contributor

@marvinhagemeister marvinhagemeister commented Jun 24, 2024

This fixes an issue when an expression is passed as the component type like:

<Foo.Bar fooBar={2} />

// Before this PR, incorrect casing
jsx(Foo.Bar, { foobar: 2 })

// After this PR
jsx(Foo.Bar, { fooBar: 2 })

Peviously, we wouldn't always treat this as a component and thus do props casing normalization. We must never touch the casing of component props though. Since we can't reliably determine if an expression holds a component or an element, we'll always treat it as a component.

Relevant Fresh issue denoland/fresh#2539

This fixes an issue when an expression is passed as the component type like:

```tsx
<Foo.Bar fooBar={2} />
``

Peviously, we wouldn't always treat this as a component and thus do props casing normalization. We must never touch the casing of component props though. Since we can't reliably determine if an expression holds a component or an element, we'll always treat it as a component.
@marvinhagemeister marvinhagemeister merged commit 427bf01 into main Jun 24, 2024
2 checks passed
@marvinhagemeister marvinhagemeister deleted the jsx-precompile-expr-component branch June 24, 2024 12:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants