Recently, I encountered the following error, while I was doing this mobile app development using React Native.
node_modules/react-native/Libraries/Debugging/DebuggingOverlayRegistry.js: /Users/bkpandey/Documents/workspace/code/ReactNative-Meet-Flow/package/node_modules/react-native/Libraries/Debugging/DebuggingOverlayRegistry.js: Class private methods are not enabled. Please add `@babel/plugin-transform-private-methods` to your configuration.
117 | };
118 |
> 119 | #findLowestParentFromRegistryForInstance(
| ^
120 | instance: ReactNativeElement,
121 | ): ?DebuggingOverlayRegistrySubscriberProtocol {
122 | let iterator: ?ReadOnlyElement = instance;
To resolve this error, you need to update your Babel configuration to include the @babel/plugin-transform-private-methods
plugin. I added @babel/plugin-transform-private-methods plugin to Babel configuration file, babel.config.js
. Updated configuration should look like this:
module.exports = {
presets: ['module:metro-react-native-babel-preset'],
plugins: [
'react-native-reanimated/plugin',
['@babel/plugin-transform-private-methods', { loose: true }]
],
};
Top comments (0)