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

未關閉
#678 2 則留言 6 個 reaction 已指派 0 人 在 GitHub 檢視

@wanxiankai 已經在處理了。

開始於 2026年7月12日。

  • #949 來自 @wanxiankai —— 未關閉

評估

難度
3/5
預估耗時
1-2 天
新手友好度
42/100
Issue 類型
缺陷
描述清晰度
基本清楚
活躍度
停滯
技術堆疊
babel, javascript, react-native, typescript

研究方向

先從 babel-preset 和連結的重現開始,然後將其行為與 tsconfig compilerOptions.jsx 設為 react-native 或 preserve 時的行為進行比較。確認這些設定會阻止套用 JSX transform plugins;完成的標準是 build 保留設定的 JSX 輸出,而不是始終產生 react-jsx。

由索引模型根據 Issue 內容生成。

描述

bug
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
主要語言
JavaScript
星號
3.2k
分支
229
平均合併
2 天 6 小時
30 天內合併 PR
6

環境準備

  • 沒有 Dockerfile 或 Docker Compose 檔案
  • 沒有 Pull Request 範本
  • 閱讀貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

callstack/react-native-builder-bob 的其他 Issue

查看 callstack/react-native-builder-bob 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。