React Native自定义框架,导入在我尝试将框架导入到Demo应用程序中时应该不做
我是新手反应本地的。我创建了自定义框架。 我能够成功地将其集成和测试。 但是,我给出的导入路径是不合适的。 我认为它应该以“ frameworkname'”导入{}导入框架,但它不起作用。 有什么原因? 如何解决此路径问题?
import ClassA from "myreact-native-framework/classes/ClassA";
import ClassB from "myreact-native-framework/classes/ClassB";
我认为它应该使用的方式是:
import {ClassA, ClassB} from "myreact-native-framework";
index.js看起来如下:
import ClassA from "./classes/ClassA";
import ClassA from "./classes/ClassB";
export default { ClassA, ClassB};
i am new to react native. i have created my custom framework.
i am able to integrate and test it with demo app successfully.
however the import path i have given is not proper.
i think it should import framework with just import {} from 'frameworkname' but its not working that way.
what can be reason?
how to fix this path issue problem?
import ClassA from "myreact-native-framework/classes/ClassA";
import ClassB from "myreact-native-framework/classes/ClassB";
i think the way it should work is:
import {ClassA, ClassB} from "myreact-native-framework";
index.js looks like below:
import ClassA from "./classes/ClassA";
import ClassA from "./classes/ClassB";
export default { ClassA, ClassB};
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
修改您的索引
。
Modify your index.js like
If it has any issues, please ask in the comments section here