#why in mantine repo use "jsx": "react"?

8 messages · Page 1 of 1 (latest)

knotty sandal
#

i mention that in tsconfig.base.json you are use "jsx": "react", but in react doc they advice use "jsx": "react-jsx". So, I'm curious why you not use it? 🙂

fading helm
knotty sandal
fading helm
# knotty sandal So, there are no hidden problems with “react-jsx”? 🤔 and we can use it safely? ...

No, since react 17 and later react-jsx is the default. It's just the new way of transforming what <HelloWorld /> turns into in the final JS file.

react: export const HelloWorld = () => React.createElement("h1", null, "Hello world");

react-jsx: export const HelloWorld = () => _jsx("h1", { children: "Hello world" });

It should have some performance improvements and other small things, but most notable difference for you as a user is that it means you don't need to do import React from 'react' anymore

knotty sandal
devout coral
knotty sandal
devout coral