-
Notifications
You must be signed in to change notification settings - Fork 80
Open
Labels
bugSomething isn't workingSomething isn't workingclose when staleThis issue is going to be closed when there is no activity for a whileThis issue is going to be closed when there is no activity for a while
Description
Description
When launching a React Native app through Radon IDE, the following error screen appears during initial launch, blocking the app from running:
Duplicate __self prop found. You are most likely using the deprecated transform-react-jsx-self Babel plugin.
Both __source and __self are automatically set when using the automatic runtime.
Please remove transform-react-jsx-source and transform-react-jsx-self from your Babel config.
This error does not appear when running the same project via Metro (yarn start).
Root Cause
@react-native/babel-preset registers both:
@babel/plugin-transform-react-jsxwith{ runtime: 'automatic' }— which automatically injects__selfand__source@babel/plugin-transform-react-jsx-selfand@babel/plugin-transform-react-jsx-sourcein dev mode — which inject__selfand__sourceagain
This causes duplicate __self props. Metro suppresses this internally, but Radon IDE's bundler treats it as an error.
Relevant code in @react-native/babel-preset/src/configs/main.js:
// Line 54-58: automatic runtime (already handles __self/__source)
if (!options.useTransformReactJSXExperimental) {
extraPlugins.push([
require('@babel/plugin-transform-react-jsx'),
{runtime: 'automatic'},
]);
}
// Line 174-177: duplicates __self/__source in dev mode
if (options && options.dev && !options.useTransformReactJSXExperimental) {
extraPlugins.push([require('@babel/plugin-transform-react-jsx-source')]);
extraPlugins.push([require('@babel/plugin-transform-react-jsx-self')]);
}Workaround
Setting useTransformReactJSXExperimental: true in babel.config.js and manually adding the JSX transform plugin resolves the error, but this requires users to modify their Babel config:
presets: [
["module:@react-native/babel-preset", { useTransformReactJSXExperimental: true }],
],
plugins: [
["@babel/plugin-transform-react-jsx", { runtime: "automatic" }],
],Environment
- Radon IDE version: 1.15.1
- Editor: Cursor (VSCode)
- React Native version: 0.79.6
- Platform: macOS (Apple Silicon)
Expected Behavior
The error should not appear. Metro bundler does not show this error with the same Babel config.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingclose when staleThis issue is going to be closed when there is no activity for a whileThis issue is going to be closed when there is no activity for a while