Created
December 17, 2025 16:01
-
-
Save betomoedano/eb0a7c9a544f0c0bc4494c0a0bfdb892 to your computer and use it in GitHub Desktop.
React Compiler cannot run on widget files because they are invoked outside React.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const path = require("path"); | |
| module.exports = function (api) { | |
| api.cache(true); | |
| const widgetDir = path.join(__dirname, "widget") + path.sep; | |
| const normalizedWidgetDir = widgetDir.replace(/\\/g, "/"); | |
| return { | |
| presets: [ | |
| [ | |
| "babel-preset-expo", | |
| { | |
| // React Compiler cannot run on widget files because they are invoked outside React. | |
| "react-compiler": { | |
| sources: (filename) => { | |
| if (!filename) { | |
| return true; | |
| } | |
| const normalizedFile = filename.replace(/\\/g, "/"); | |
| return !normalizedFile.startsWith(normalizedWidgetDir); | |
| }, | |
| }, | |
| }, | |
| ], | |
| ], | |
| plugins: ["react-native-reanimated/plugin"], | |
| }; | |
| }; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment