React Native Dynamically load modules/plugins?

穿精又带淫゛_ 提交于 2020-01-05 03:33:15

问题


As far as I've searched it appears to be impossible to load modules (=plugins/libraries?) dynamically (I'm very new to React Native..).

What I'd like to accomplish is to let the user of the app load additional functions as she/he desires.

Example: A user wants to add a music plugin to the app.

Intuitively, I'd long for something like dynamic library loading. The user would fetch the library, it'll be loaded into the code and can then be executed. However, in React Native it seems like there are only modules that can be loaded?

Alternatively, I'd hope that auto-updating the app would allow to add modules "on-the-fly" ( https://github.com/aerofs/react-native-auto-updater or www.npmjs.com/package/react-native-hot-load ). But I fear that this is only for JS and data content?

The ability to dynamically add functionality to the app is an essential part of the app. I have no previous experience worth mentioning in mobile app development.

Question: Is it possible to dynamically add functionality (also native in nature) to React Native apps? If not, would there be a workaround?

EDIT: I have found the following repository on github: https://github.com/yusefnapora/react-dynamic-linking-example . Unfortunately, without any description. I have no idea about Objective-C, but the repo name sounds promising. Anybody knows what its purpose is?

来源:https://stackoverflow.com/questions/40249045/react-native-dynamically-load-modules-plugins

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!