简体   繁体   中英

How to use jsconfig.json in React Native project

I have a MStore source and I read that code. In this code use jsconfig.json file and in screens importing the components or screens with this structure:

import { Home , Splash , Login } from '@containers';

this is the jsconfig.json file, stored in location MyReactNativeProject/src/ :

{
  "compilerOptions": {
    "baseUrl": "./src/",
    "paths": {
      "@common": ["common"],
      "@containers": ["containers"],
      "@components": ["components"],
      "@navigation": ["navigation"],
      "@images": ["images"],
      "@services": ["services"],
      "@utils": ["utils"],
      "@redux": ["redux"]
    }
  },
  "exclude": ["node_modules"]
}

how can I use this config and this importing these components in my project?

Try it with babel.config.js or .babelrc file as it's here

You need to include babel-plugin-module-resolver

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM