While using Typescript with React we have to specify jsx in compilerOptions in tsconfig.json file.
It has preserve, react, react-native, react-jsx etc. as allowed values.
{
"compilerOptions": {
"jsx": "react-jsx" | "react" | "react-native" | "preserve"
}
}
react and react-jsx are mostly used for web
I want to understand the difference between the 2 options and which one to choose when
react translates jsx to React.createElement()
react-jsx translates jsx to _jsx() and _jsxs()
Also what is the difference between _jsx() and _jsxs() ?