Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to reuse the React JS component in React Native

I am new to React JS. I am trying to build a web application which should also work on mobile (Android and IOS) so thought of using react js for web application and created few components. so is it possible to use the React js component in React native.

like image 207
Akash Rao Avatar asked Jun 18 '16 15:06

Akash Rao


Video Answer


1 Answers

It's good that you plan in advance. 100% matching between JS and Native won't be possible, but with careful planning, you could get to reuse a good deal.

You may want to take a look at React Native Web project that mirrors Native-specific components for Web (e.g. View, Image, Text, etc).

I suggest building a simple prototype in React JS and then in React Native so you get some understanding of the differences in the two ecosystems. Having a hands on experience will prove more beneficial than any writeup :)

like image 123
Grgur Avatar answered Sep 23 '22 09:09

Grgur