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

experimentalReactChildren breaks self-closing tags #8432

Closed
1 task done
otaviomad opened this issue Sep 6, 2023 · 0 comments · Fixed by #8455
Closed
1 task done

experimentalReactChildren breaks self-closing tags #8432

otaviomad opened this issue Sep 6, 2023 · 0 comments · Fixed by #8455
Assignees
Labels
- P3: minor bug An edge case that only affects very specific usage (priority) pkg: react Related to React (scope)

Comments

@otaviomad
Copy link

otaviomad commented Sep 6, 2023

Astro Info

Astro                    v3.0.8
Node                     v20.5.0
System                   macOS (arm64)
Package Manager          yarn
Output                   static
Adapter                  none
Integrations             @astrojs/react
                         @astrojs/mdx

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

No response

Describe the Bug

When using experimentalReactChildren, self closing tags break. If you use any void tag (such as hr or input) inside of a react component, you get the error:

(...) is a self-closing tag and must neither have `children` nor use `dangerouslySetInnerHTML`.

What's the expected result?

Self closing tags should be preserved

Link to Minimal Reproducible Example

https://stackblitz.com/edit/github-42py6u?file=src%2Fpages%2Findex.astro
(refresh the page to see the actual correct error)

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 Sep 6, 2023
@otaviomad otaviomad changed the title experimentalReactChildren breaks self-closings tags experimentalReactChildren breaks self-closing tags Sep 6, 2023
@lilnasy lilnasy added pkg: react Related to React (scope) - P3: minor bug An edge case that only affects very specific usage (priority) and removed needs triage Issue needs to be triaged labels Sep 6, 2023
@natemoo-re natemoo-re self-assigned this Sep 7, 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) pkg: react Related to React (scope)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants