-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Allow using JSX before calling super when using --jsx-dev #3454
Comments
@evanw is this something you would want esbuild to support? I might be able to help implementing this if I get a few pointers. |
FWIW TypeScript doesn't seem to handle this case either. It's too bad that there doesn't seem to be a specification for the new React JSX transform, or at least not one that adequately describes it. I can only find this which links to this which doesn't describe what |
Thanks for fixing this and adding the detailed explanation and changelog entry! Frustrating that there isn’t a specification for this. |
esbuild does not support using JSX inside a constructor before calling super when using the
--jsx-dev
flag . This seems like a bug. Note that Babel supports this.When
--jsx-dev
the compiled version includesthis
as the last argument of the JSX function, which is problematic if you have some JSX defined inside a class constructor before calling super because you cannot access this before that point.Reproduction
Related
vitejs/vite-plugin-react#231
babel/babel#14271
The text was updated successfully, but these errors were encountered: