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

JSX expression error when using <= #894

Open
1 task
hfournier opened this issue Nov 20, 2023 · 0 comments
Open
1 task

JSX expression error when using <= #894

hfournier opened this issue Nov 20, 2023 · 0 comments
Labels
- P3: minor bug An edge case that only affects very specific usage (priority)

Comments

@hfournier
Copy link

Astro Info

Astro                    v3.5.5
Node                     v18.17.1
System                   Windows (x64)
Package Manager          npm
Output                   static
Adapter                  none
Integrations             @astrojs/tailwind
                         @astrojs/mdx

If this issue only occurs in one browser, which browser is a problem?

No response

Describe the Bug

The following code block results in an error: "Unable to assign attributes when using <> Fragment shorthand syntax!"

{
  mydata.length <= 10 && (
    <ul>
      {mydata.map((item) => (
        <li>{item}</li>
      ))}
    </ul>
  )
}

changing the expression to mydata.length < 10 works as expected, so having <= is causing the issue.

What's the expected result?

The JSX expressions should be evaluated and not interpreted as fragments.

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-foh8kw?file=src%2Fpages%2Findex.astro

Participation

  • I am willing to submit a pull request for this issue.
@github-actions github-actions bot added the needs triage Issue needs to be triaged label Nov 20, 2023
@lilnasy lilnasy transferred this issue from withastro/astro Nov 22, 2023
@lilnasy lilnasy added - P3: minor bug An edge case that only affects very specific usage (priority) and removed needs triage Issue needs to be triaged labels Nov 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- P3: minor bug An edge case that only affects very specific usage (priority)
Projects
None yet
Development

No branches or pull requests

2 participants