How To Solve React Native: Unexpected token ‘:’. Expected a ‘)’ or a ‘,’ after a parameter declaration

Update babel.config.js of your project

from:

module.exports = {
    presets: ['module:metro-react-native-babel-preset'],
};

to:

module.exports = {
    presets: [['module:metro-react-native-babel-preset', {
        unstable_disableES6Transforms: true
    }]],
};

Run npm start –reset-cache to restart app.

Leave a Reply

Up ↑

%d bloggers like this: