Unexpected labeled statement - React Native

I'm creating a react native app and have a component that only return values, but it give me an error Unexpected labeled statement which I think is the reason my app crashes when I run npx react-native start.

import {Dimensions} from 'react-native';

export default function () {
  MAX_WIDTH: Dimensions.get('screen').width;
  MAX_HEIGHT: Dimensions.get('screen').height;
  GAP_SIZE: 300;
}

Solution 1:

If all you want to do is return some data then what you can do is create an object, assign the values to it and export it as the default like this:

import {Dimensions} from 'react-native';

const Data = {
    MAX_WIDTH: Dimensions.get('screen').width,
    MAX_HEIGHT: Dimensions.get('screen').height,
    GAP_SIZE: 300,
}

export default Data;