-
Notifications
You must be signed in to change notification settings - Fork 581
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
Correctly handle arrow function expression arguments when used with non-'on' properties #1672
base: main
Are you sure you want to change the base?
Conversation
…on-'on' properties
🦋 Changeset detectedLatest commit: a26ce0a The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
View your CI Pipeline Execution ↗ for commit a26ce0a.
☁️ Nx Cloud last updated this comment at |
Deploying mitosis with Cloudflare Pages
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice! just need to tweak the changeset format
'@builder.io/mitosis': patch | ||
--- | ||
|
||
Fix arrow function expressions in non-on properties |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
on how to format the changesets https://github.com/BuilderIO/mitosis/blob/main/CONTRIBUTING.md#changeset-format
@@ -282,11 +282,9 @@ export const jsxElementToJson = ( | |||
if (types.isStringLiteral(expression)) { | |||
// <Foo myProp={"hello"} /> | |||
memo.properties[key] = expression.value; | |||
} else if (types.isArrowFunctionExpression(expression)) { | |||
} else if (key.startsWith('on') && types.isArrowFunctionExpression(expression)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so the fix for non-on
properties is to not have them run this code for isArrowFunctionExpression
?
Description
Handle arrow function expressions for non-on properties. See https://mitosis.builder.io/playground/?code=KYDwDg9gTgLgBAE2AMwIYFcA29noHYDGMAlhHnALICeAwhALaR7B4wAUAlHAN4BQvcOFGAx0UcmwGDpAHmJ4w6GFOlwYwAM4wAvNzaoANHABGRgl20A%2BOKjgBqE%2FbgEAviukB6S1I4BuXi5AA%3D%3D%3D for an example of how it is currently broken.
yarn fmt:prettier
.yarn test:update
yarn g:changeset
and follow the CLI instructions. Alternatively, use the Changeset Github Bot to create the file.