React Class来管理导入

时间:2017-10-12 15:58:23

标签: javascript reactjs react-native

我怎样才能创建一个管理我所有导入路径的react类? 喜欢

import Paths from './Paths'
import LoginScreen from Paths.LoginScreen

因为Visual Studio Code没有重构功能。

的package.json

{
    "name": "githubrepo",
    "version": "0.0.1",
    "private": true,
    "scripts": {
        "start": "node node_modules/react-native/local-cli/cli.js start",
        "test": "jest"
    },
    "dependencies": {
        "axios": "^0.16.2",
        "native-base": "^2.3.2",
        "react": "16.0.0-alpha.12",
        "react-native": "0.48.3",
        "react-navigation": "^1.0.0-beta.11"
    },
    "devDependencies": {
        "babel-jest": "21.0.2",
        "babel-preset-react-native": "4.0.0",
        "jest": "21.1.0",
        "react-test-renderer": "16.0.0-alpha.12"
    },
    "jest": {
        "preset": "react-native"
    }
}

1 个答案:

答案 0 :(得分:0)

如果您使用的是导出关键字,例如:

TextView tv;

可以通过以下方式管理进口:

export class LoginScreen..... etc