如何从Java的本机Android活动打开React Native应用程序的特定组件? [英] How can I open a specific component of my React Native application from an Native Android Activity in Java?

查看:101
本文介绍了如何从Java的本机Android活动打开React Native应用程序的特定组件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

警告-这个问题基本上是关于一种方法的.因此,不会有任何共享的工作笔或代码!

Alert - This question is basically about an approach. So there wont be any working pen or code to share!

我正在做一个POC,其中将RN应用程序集成到Android应用程序中.我确实成功地遵循了此 .
点击鼠标左键进入RN按钮,RN活动开始,页面B被加载.到这里一切都很好.现在我想知道如何在页面A中引入RN组件.例如,页面A上的按钮可以是RN组件吗?或如何从Java的本机Android活动中打开我的React Native应用程序的特定组件?
我必须检查react-native repo中的ReactActivity才能看到捆绑包如何呈现到根视图.在我的情况下唯一改变的是我不想渲染到根视图.这是文件 Link1 链接2
在RN gitbub页面中询问此问题-链接-他们重定向到SO.因此,请分享您的建议或方法

I was doing a POC where integrating an RN app into an Android App. I did successfully following this .
onclick of click to got to RN button,RN activity started and page B get loaded. Upto here all good. Now i am wondering where i can introduce a RN component into page A. for example the button on page A can be RN component ? or How can I open a specific component of my React Native application from an Native Android Activity in Java?
guess I have to check the ReactActivity in react-native repo to see how the a bundle gets rendered to the root view. The only thing that changes in my case is that I don't want to render to root view. Here is files Link1 and Link2
This Q is asked in RN gitbub page - Link - and they redirected to SO. So please share you suggestion or approach

推荐答案

将Java中的Native应用程序和React Native应用程序结合起来实在是一个坏主意.但这是可能的.您可以从此处a>以及教程

This is really bad idea to combine Native app in Java and React Native app. But it's possible. You can get some code samples from here along with this tutorial

这篇关于如何从Java的本机Android活动打开React Native应用程序的特定组件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆