callstack / callstack/react-native-builder-bob

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

Abierto
#678 2 comentarios 6 reacciones 0 asignados Ver en GitHub
bug
Lenguaje dominante
JavaScript
Estrellas
3.2k
Forks
228
Merge medio
7 d 12 h
PR fusionados (30 d)
3

Descripción

### 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
- [x] react-native-builder-bob

### Selected options

-

### Link to repro

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

### Environment

-

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.