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

Can not override jsx option in tsconfig #1888

Open
hyoban opened this issue Nov 7, 2023 · 1 comment
Open

Can not override jsx option in tsconfig #1888

hyoban opened this issue Nov 7, 2023 · 1 comment

Comments

@hyoban
Copy link

hyoban commented Nov 7, 2023

Environment

Nitro 2.7.2
Node 20.9.0

Reproduction

https://stackblitz.com/edit/github-nwbg1j?file=nitro.config.ts

Run npm run typecheck after installing dependence.

Describe the bug

In #1303, in order to support jsx/tsx, the default parameters of jsxFactory and jsxFragment are added. But this affects me setting jsx option of tsconfig to react-jsx even though I'm not using nano-jsx.

Additional context

No response

Logs

No response

@igorjacauna
Copy link
Contributor

Hi!

I tried include in nitro.config.ts

esbuild: {
  options: {
    jsxFactory: 'React.createElement',
    jsxFragment: 'React.Fragment',
  }
}

And in tsconfig.json:

{
  "extends": "./.nitro/types/tsconfig.json",
  "compilerOptions": {
    "jsxFactory": "react",
    "jsxFragmentFactory": "React.Fragment"
  }
}

And it worked for use react and react-dom to render in server side with renderToStaticMarkup from react-dom/server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants