修改
也许我发现了问题,如果有人可以确认这种情况:似乎test.js
正在导入index.js
导入test.js
,export
没有停止无限-loop包含......是不是?有没有像那样的解决方法如果它是调用的,请不要包含此文件?
我面临一个奇怪的问题。我正在尝试从重新导出中导入一些对象(tcomb-react-native与此处无关,因为问题出在import/export
)。
|-- index.js
|-- simpleTypes.js
|-- userType.js
index.js :
export { UserType, UserTypeBase } from './test';
export { TextMax9Type } from './simpleTypes';
simpleTypes.js :
import t from 'tcomb-form-native';
export const TextMax9Type = t.refinement(t.String, s => s.length <= 9);
test.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);
NOT WORKING错误: 提供给struct(props,[name])组合器的无效参数props {}(期望字典String-&gt; Type)
那么导出空对象的重新导出问题是什么?