I encountered an issue while utilizing a data file for mapping over in a React Native component. The error message displayed is as follows:
The error states: "No identifiers allowed directly after numeric literal."
File processed with loaders: "../../../../../../usr/local/lib/node_modules/expo-cli/node_modules/babel-loader/lib/index.js.
An additional loader may be required to handle the output of these loaders. name: 'C.Ronaldo', match: 'BEL v POR', > price: 12_200_000, position: 'FWD', totalPoints: 29.
Interestingly, it's highlighting the price in data.js: > price: 12_200_000,
babel.config.js
module.exports = function(api) {
api.cache(true);
return {
presets: ['babel-preset-expo']
};
};
players.js
export const players = [
{
id: '1',
name: 'C. Ronaldo',
match: 'BEL v POR',
price: 12_200_000,
position: 'FWD',
totalPoints: 29
},
...
component I am using to iterate over the data and types file:
enum Positions {
FWD,
MID,
DEF,
GK,
}
export type Player = {
id: string;
name: string;
match: string;
price: number;
position: Positions;
totalPoints: number;
};
import React from "react";
...