2

编辑 也许我发现了问题,想知道是否有人可以确认情况:似乎test.js正在 importing index.jswhich is importing test.js,并且export没有停止无限循环包含...对吗?是否有任何解决方法,例如不要包含此文件,如果它是调用文件


我面临一个奇怪的问题。我正在尝试从重新导出中导入一些对象(tcomb-react-native在这里不相关,因为问题在于import/export)。

|-- index.js
|-- simpleTypes.js
|-- userType.js

index.js

export { UserType, UserTypeBase } from './test';
export { TextMax9Type } from './simpleTypes';

简单类型.js

import t from 'tcomb-form-native';
export const TextMax9Type = t.refinement(t.String, s => s.length <= 9);

测试.js

import t from 'tcomb-form-native';
// import { TextMax9Type } from './'; // <----- NOT WORKING!
import { TextMax9Type } from './simpleTypes'; // <----- OK no error

export const UserTypeBase = {
    Name: TextMax9Type,
    Surname: TextMax9Type,
};

export const UserType = t.struct(UserTypeBase);

不工作错误提供给 struct(props, [name]) 组合器的参数 props {} 无效(应为字典字符串-> 类型)

那么导出空对象的再导出问题是什么?

4

0 回答 0