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 building JSX that contains a large object (>5 properties) then JSX in a prop #807

Merged
merged 1 commit into from Aug 29, 2021

Conversation

lPadier
Copy link
Contributor

@lPadier lPadier commented Aug 29, 2021

When building a JSX node with an object with more than 5 properties and a JSX prop, this fixes the following error:

TypeError: this[node.value.type] is not a function

Creating a new wmr project with the following public/index.js currently fails:

export function App() {
  return (
    <div
      style={{
        top: 0,
        bottom: 0,
        left: 0,
        right: 0,
        position: "relative",
        display: "block",
      }}
      children={<hr />}
    />
  );
}

If the children prop is placed before the style prop, the build succeeds.

This was introduced in 2bfb296

@changeset-bot
Copy link

changeset-bot bot commented Aug 29, 2021

🦋 Changeset detected

Latest commit: be5cda0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
wmr Patch

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

When building a JSX node with an object with more than 5 properties and a JSX prop, this fixes the following error:
```
TypeError: this[node.value.type] is not a function
```
Copy link
Member

@marvinhagemeister marvinhagemeister left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch! Thanks a bunch for the PR 👍

@lPadier
Copy link
Contributor Author

lPadier commented Aug 29, 2021

I force pushed to add a changeset, but I'm not sure how clear the wording of the changeset is

Copy link
Member

@developit developit left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Funky!

@marvinhagemeister marvinhagemeister merged commit 7774d9e into preactjs:main Aug 29, 2021
@github-actions github-actions bot mentioned this pull request Aug 29, 2021
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.

None yet

3 participants