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

TypeScript builds ignore tsconfig compilerOptions.jsx. Output is always 'react-jsx' #678

Open
1 of 2 tasks
marklawlor opened this issue Nov 8, 2024 · 0 comments
Open
1 of 2 tasks
Labels
bug Something isn't working

Comments

@marklawlor
Copy link

Description

Libraries built with react-native-builder-bob do not respect the tsconfig.config#compilerOptions.jsx setting, and force the output to be react-jsx. This is a problem for React Native libraries which normally publish as jsx: 'react-native' or 'preserve'.

Libraries such as @emotion/native and NativeWind both rely on setting a custom jsxImportSource, which only works when a library has been published with persevered JSX. This means libraries built with react-native-builder-bob will stop working with these libraries.

The cause of this issue is the babel-preset, which should conditionally turn off '@babel/plugin-transform-react-jsx' / '@babel/plugin-transform-react-jsx-development' when jsx is set to react-native or preserve.

Packages

  • create-react-native-library
  • react-native-builder-bob

Selected options

Link to repro

https://github.com/marklawlor/react-native-builder-bob-jsx

Environment

@marklawlor marklawlor added the bug Something isn't working label Nov 8, 2024
@marklawlor marklawlor changed the title The jsx option from tsconfig#compilerOptions is not respected TypeScript builds ignore tsconfig compilerOptions.jsx. Output is always 'react-jsx' Nov 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant