Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

React Native 相关,Prettier ESLint Redux Rematch使用

NotificationsYou must be signed in to change notification settings

syanbo/RNPlayground

Repository files navigation

设置路径别名支持IDE跳转联想

  • yarn add -D babel-plugin-root-import
  • babel.config.js 添加 plugins
module.exports = {  presets: ['module:metro-react-native-babel-preset'],  plugins: [    [      'babel-plugin-root-import',      {        paths: [          {            rootPathPrefix: '~',            rootPathSuffix: 'src',          },        ],      },    ],  ],};
  • 在项目根目录下添加jsconfig.json
{  "compilerOptions": {    "jsx": "react-native",    "allowSyntheticDefaultImports": false,    "experimentalDecorators": true,    "baseUrl": ".",    "paths": {      "~/*": ["src/*"]    }  },  "include": ["src/**/*"],  "exclude": ["node_modules"]}
  • 在项目中愉快的使用
import env from '~/constants/env';

About

React Native 相关,Prettier ESLint Redux Rematch使用

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp