0

i have a config.json file where i stocked all my BaseUrls and API_KEYS but, when i'm trying to import these from other component i get this error : **Should not import the named export 'API_URL_Geo' (imported as 'config') from default-exporting module (only default export is available soon) **, i tried 2 methods of importing

import * as config from "../config.json";

config.API_URL_GEO

and

import {API_URL_Geo} from "../config.json";

but i still get same errors, any help ?

MythLoud
  • 35
  • 5

1 Answers1

1

i found the answer was pretty simple, just importing config directly here it is :

import config from "../config.json";

and then access everything like this :

API_KEY_1 = config.API_KEY_1
MythLoud
  • 35
  • 5