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

createElement() is not a thing in modern JSX #7135

Closed
manucorporat opened this issue Mar 23, 2023 · 3 comments
Closed

createElement() is not a thing in modern JSX #7135

manucorporat opened this issue Mar 23, 2023 · 3 comments
Labels

Comments

@manucorporat
Copy link

Describe the bug

#7128

While this PR solves a great issue, it emits creatElement() which is a React only API for backcompatibility, since key is part of the props. It would be great to have a way to emit modern JSX only, without fallback to support a legacy / only-react API.

Input code

No response

Config

No response

Playground link

No response

Expected behavior

Always emit jsx(), never createElement()

Actual behavior

No response

Version

nightly

Additional context

No response

@kwonoj
Copy link
Member

kwonoj commented Mar 23, 2023

I'm not sure if I understood this correctly: are you saying swc does not allow to use new api, or either there is a condition forces your code transpiled into createelement?

@magic-akari
Copy link
Member

Almost all transpilation toolchains give the same result. No configuration is provided to mandate the use of "modern" JSX.

@kwonoj kwonoj closed this as completed Mar 23, 2023
@swc-bot
Copy link
Collaborator

swc-bot commented Apr 23, 2023

This closed issue has been automatically locked because it had no new activity for a month. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.

@swc-project swc-project locked as resolved and limited conversation to collaborators Apr 23, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Development

No branches or pull requests

4 participants