Requiring Modules in react-native

后端 未结 3 1659
天涯浪人
天涯浪人 2021-01-06 11:38

I\'m stuck on a problem in a react-native project. I\'m trying to do a general require file, where I export all my modules. After that I would like to require only my \"requ

3条回答
  •  孤城傲影
    2021-01-06 11:47

    This is way old, but the record needs to be corrected. Require isn't async. You can tell this easily by inspecting the object returned (not a promise).

    Re-exporting in ES6 is simple.

    For example:

    export * from './types';
    export { default as ApiClient } from './ApiClient';
    

提交回复
热议问题