From ec9c722840d8b72b19ee296b8a9d3dcb8679a9b5 Mon Sep 17 00:00:00 2001 From: Yinchao Chen Date: Sat, 18 Apr 2026 12:17:27 +0200 Subject: [PATCH] fix(types): use react-jsx transform to fix JSX component type error in TS 5.x With TypeScript 5.1+ and React 18's updated @types/react, components compiled with "jsx": "react" emit declarations using the global JSX.Element which is no longer assignable to ReactNode, causing the 'cannot be used as a JSX component' error at the consumer side. Switching to "jsx": "react-jsx" (+ jsxImportSource) makes TypeScript emit React.JSX.Element, which is compatible with the new React 18 type hierarchy. Fixes #132 --- packages/media-console/tsconfig.json | 3 ++- packages/reanimated/tsconfig.json | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/media-console/tsconfig.json b/packages/media-console/tsconfig.json index 8463a29..5c4bddd 100644 --- a/packages/media-console/tsconfig.json +++ b/packages/media-console/tsconfig.json @@ -4,7 +4,8 @@ "allowUnusedLabels": false, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, - "jsx": "react", + "jsx": "react-jsx", + "jsxImportSource": "react", "lib": [ "esnext" ], diff --git a/packages/reanimated/tsconfig.json b/packages/reanimated/tsconfig.json index 8463a29..5c4bddd 100644 --- a/packages/reanimated/tsconfig.json +++ b/packages/reanimated/tsconfig.json @@ -4,7 +4,8 @@ "allowUnusedLabels": false, "esModuleInterop": true, "forceConsistentCasingInFileNames": true, - "jsx": "react", + "jsx": "react-jsx", + "jsxImportSource": "react", "lib": [ "esnext" ],