Is Babel Plugin Setup Necessary for Latest React Native Versions?
I’m using react-native-worklets-core with react-native-vision-camera-barcodes-scanner for barcode scanning. My app uses a frame processor with useFrameProcessor, which relies on Worklets to run JavaScript code on a separate thread.
According to the documentation, I should add the react-native-worklets-core/plugin to my babel.config.js:
module.exports = {
plugins: [
["react-native-worklets-core/plugin"],
],
};
For me, this setup is essential on React Native 0.73.6. Without it, the app throws a FATAL EXCEPTION at runtime (Android). However, on React Native 0.75.4, the Worklet works perfectly without any issues without the Babel plugin.
Could someone clarify why this is the case? Does React Native 0.75 or its associated Babel preset (@react-native/babel-preset) include built-in support for Worklets, eliminating the need for the react-native-worklets-core/plugin? Or is there another reason this works in newer versions?
Thank you for your time and expertise! I’d greatly appreciate any insights you can provide.