【发布时间】:2019-11-25 03:29:33
【问题描述】:
在我的 React-Native 应用程序中,导入路径是这样的。
import {
ScreenContainer,
SLButton,
SLTextInput,
} from '../../../../../components';
import { KeyBoardTypes } from '../../../../../enums';
import { SIGN_UP_FORM } from '../../../../constants/forms';
我见过一些应用程序,没有'../../../'s 的路径更加清晰和优雅。我怎样才能在 React-Native 中实现这一点?
我在我的解决方案中看到,在每个文件夹中都有一个 package.json 文件。我不确定这是否是正确的做法。
【问题讨论】:
-
如何使用绝对路径
标签: javascript node.js reactjs typescript react-native