Referring to the official TypeScript documentation:
The react mode will emit React.createElement, does not require a JSX transformation before use, and the output file will be .js.
The react-native mode is similar to preserve as it retains all JSX code, but the output file will have a .js extension.
However, most tutorials I've seen only mention the react mode:
"jsx": "react"
Although this setup works seamlessly with no warnings, I am curious about how React Native can compile TSX files without any issues.
In essence:
- What's the rationale behind having a separate
react-native
mode when React Native supports thereact
mode? - Is there a performance advantage in using one mode over the other?