简体   繁体   English

如何将ReactJS Web代码与新的React Native项目集成在一起?

[英]How to integrate ReactJS web code with a new React Native project?

I have web application code which is written using react js framework. 我有使用react js框架编写的Web应用程序代码。 Now our client wants to create mobile application using hybrid apps concept by having common code base because ift will be easy if client introduce some thing new feature in web , developing for mobile should be minimal challenge. 现在,我们的客户希望通过具有通用代码库来使用混合应用程序概念来创建移动应用程序,因为如果客户在Web中引入一些新功能,则ift会很容易,因此为移动设备开发应该是最小的挑战。 So Is it possible to convert or reuse the web code which is written on react js to react native?? 那么是否有可能转换或重用在react js上编写的Web代码以响应native?

Can anyone please suggest with any coding/project examples. 任何人都可以提出任何编码/项目示例的建议。

Can anyone please suggest which hybrid framework i can go for when i have react.js web application code. 任何人都可以建议我拥有react.js Web应用程序代码时可以使用哪种混合框架。

Thanks in advance. 提前致谢。

You can reuse some code in both. 您可以在两者中重用一些代码。 For example if you and using redux for api, you can reuse the same redux logic for web and native. 例如,如果您将redux用于api,则可以将相同的redux逻辑重新用于Web和本机。 You can use util functions which are same for web and native. 您可以使用与Web和本机相同的util函数。 One way is to make seperate repo for the common code and install it in node modules in web and native. 一种方法是为通用代码创建单独的存储库,并将其安装在Web和本机的节点模块中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM