{"id":4311,"date":"2020-01-08T05:05:43","date_gmt":"2020-01-08T05:05:43","guid":{"rendered":"https:\/\/www.folio3.com\/mobile\/?p=4311"},"modified":"2022-09-12T11:29:59","modified_gmt":"2022-09-12T11:29:59","slug":"sharing-code-between-react-and-react-native","status":"publish","type":"post","link":"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/","title":{"rendered":"Sharing Code Between React And React Native"},"content":{"rendered":"\n<p>Code reuse intends to save time and resources, and reduce redundancy by taking benefit of assets that have already been designed or developed in some form within the software product development process. You can reuse a lot of code between React and React Native e.g. business logic, utilities, helpers, API fetching logic, etc. But don&#8217;t overreach on what you&#8217;re sharing because doing so may leave your code harder to maintain.<\/p>\n\n\n\n<p>UI components will have to be written separately for both mobile and web. <\/p>\n\n\n\n<p><strong>Contents of &#8216;shared&#8217; folder:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Business logic<\/li><li>Communication with API<\/li><li>State management classes: Stores, Reducers, Actions<\/li><li>Helpers<\/li><li>Constants<\/li><li>Storage Services<\/li><li>HOCs (Higher-Order Components)<\/li><\/ul>\n\n\n\n<p><strong><strong>Contents of &#8216;web&#8217; &amp; &#8216;mobile&#8217; folder<\/strong>:<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Presentational components<\/li><li>Navigation \/ Routing<\/li><li>Styles<\/li><\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Setting up a shared project<\/strong><\/h2>\n\n\n\n<p>Open terminal. Make sure you are in the project root folder. <\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Run the following command to create the mobile, web, and shared folders:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>$ mkdir -p packages\/shared\/src packages\/mobile packages\/web<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Create a new React Native project using <code>react-native-cli<\/code> inside <code>packages\/mobile<\/code><\/li><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><li>Create a new React app using <code>create-react-app<\/code> inside<code> packages\/web<\/code><\/li><\/ul>\n\n\n\n<ul class=\"wp-block-list\"><li>Create a &#8216;<code>package.json<\/code>&#8216; file in the root directory to enable yarn workspaces and paste the following:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"name\": \"monorepo\",\n    \"private\": true,\n    \"workspaces\": {\n        \"packages\": &#91;\n            \"packages\/*\"\n        ],\n        \"nohoist\": &#91;]\n    },\n    \"dependencies\": {\n        \"react-native\": \"0.69.5\"\n    }\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Create a shared folder<\/h3>\n\n\n\n<p>Now create a shared folder where the shared code of the React and React Native apps will reside.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ mkdir -p packages\/shared<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Create a &#8216;<code style=\"background-color: rgb(255, 255, 255); font-size: 16px;\">package.json<\/code>&#8216; file inside the shared folder and paste the following:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>{\n    \"name\": \"@monorepo\/shared\",\n    \"version\": \"1.0.0\",\n    \"dependencies\": {}\n}<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Directory Structure<\/h3>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/alLsg6VOeJDN31UFwTNrTTGR6p_DV7wDA0VKDE0v23ttoctApbkD2uIQhIFc8aY-jXCrglo_wr4x5Q2C4X4h-nZgBaD2bk2RGvU3xqz8Tb6NzL3rbLQTwBa9gH9-XEdqmwiQ3Z4QEGM\" alt=\"This image has an empty alt attribute; its file name is alLsg6VOeJDN31UFwTNrTTGR6p_DV7wDA0VKDE0v23ttoctApbkD2uIQhIFc8aY-jXCrglo_wr4x5Q2C4X4h-nZgBaD2bk2RGvU3xqz8Tb6NzL3rbLQTwBa9gH9-XEdqmwiQ3Z4QEGM\"\/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Configure the web (React) application<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>In your terminal, change the directory to packages\/web and run the following commands:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install react-app-rewire-yarn-workspaces react-app-rewired --save-dev<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Replace the scripts section in the package.json file with the following:<br><\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>\"scripts\": {\n    \"start\": \"react-app-rewired start\",\n    \"build\": \"react-app-rewired build\",\n    \"test\": \"react-app-rewired test --env=jsdom\",\n    \"eject\": \"react-app-rewired eject\"\n}<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Create a new file named &#8216;<code>config-overrides.js' <\/code>inside web folder and paste the following:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>const rewireYarnWorkspaces = require(\"react-app-rewire-yarn-workspaces\");\n\nmodule.exports = function override(config, env) {\n    return rewireYarnWorkspaces(config, env);\n}<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Now run the following command to install the dependencies:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>yarn install<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Configure the mobile (React Native) application<\/h2>\n\n\n\n<p>Configuring a React Native app through monorepo is a bit tricky. Firstly, change the directory to packages\/mobile on your terminal. Now, you will need to understand two things before making workspaces work.<\/p>\n\n\n\n<ol class=\"wp-block-list\"><li>No Hoist<\/li><li>Symlinking<\/li><\/ol>\n\n\n\n<h3 class=\"wp-block-heading\">1. No Hoist<\/h3>\n\n\n\n<p>Inside the package.json file, the packages that you list down under &#8220;nohoist&#8221; tag will only be available for mobile and will not be hoisted globally.<\/p>\n\n\n\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh3.googleusercontent.com\/8AuiZD1HMqHxue2C9KKG0dkU6qcPafw1b9z2QI0E6swCVnmepeJ_ToDJs2VLnkXOZBoTTTReUUQytZaFNp9Z4F_nXer1qNZWDWHMUz4EHmw-L1IqrGyL_UH3BbdiAdEOKDexoBS2Ci8\" alt=\"\"\/><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\">2. Symlinking<\/h3>\n\n\n\n<p><em>A symlink<\/em> is a term used for any file that contains a reference to another file or package. To achieve symlinking, we will use &#8216;wml&#8217;.<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Install wml globally using the following command:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>npm install -g wml<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Copy the  by running the following command in the root directory:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>wml add packages\/shared packages\/mobile\/node_modules\/@monorepo\/shared<\/code><\/pre>\n\n\n\n<ul class=\"wp-block-list\"><li>Start wml using the following command:<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>wml start<\/code><\/pre>\n\n\n\n<p>Once you run the above command, you should see an output something like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"415\" src=\"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-07-at-6.12.44-PM-1024x415.png\" alt=\"\" class=\"wp-image-5725\" srcset=\"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-07-at-6.12.44-PM-1024x415.png 1024w, https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-07-at-6.12.44-PM-300x122.png 300w, https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-07-at-6.12.44-PM-768x312.png 768w, https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-07-at-6.12.44-PM-1536x623.png 1536w, https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-07-at-6.12.44-PM-2048x831.png 2048w, https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-07-at-6.12.44-PM-1200x487.png 1200w, https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-07-at-6.12.44-PM-353x143.png 353w\" sizes=\"(max-width: 709px) 85vw, (max-width: 909px) 67vw, (max-width: 1362px) 62vw, 840px\" \/><\/figure>\n\n\n\n<p>In case no output gets displayed, then follow this answer to get the issue fixed: <a href=\"https:\/\/github.com\/wix\/wml\/issues\/38#issuecomment-521570796\">https:\/\/github.com\/wix\/wml\/issues\/38#issuecomment-521570796<\/a><\/p>\n\n\n\n<p>You can now develop and import functions from the shared folder inside the components in the web and mobile folders. Add a file inside packages\/shared\/src folder and export a function inside it. You should then be able to import the function inside your web and mobile files like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>import { functionName } from '@monorepo\/shared\/src\/fileName';<\/code><\/pre>\n\n\n\n<p>This is how we set up a project to share code between React and React Native applications. Thanks for reading!<\/p>\n\n\n<p><iframe src=\"https:\/\/www.youtube.com\/embed\/O8d_42Wc-po\" width=\"853\" height=\"480\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/p>","protected":false},"excerpt":{"rendered":"<p>Code reuse intends to save time and resources, and reduce redundancy by taking benefit of assets that have already been designed or developed in some form within the software product development process. You can reuse a lot of code between React and React Native e.g. business logic, utilities, helpers, API fetching logic, etc. But don&#8217;t &hellip; <a href=\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;Sharing Code Between React And React Native&#8221;<\/span><\/a><\/p>\n","protected":false},"author":9,"featured_media":4452,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[],"class_list":["post-4311","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blog"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.6 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Sharing Code Between React And React Native - Mobile App Development Services<\/title>\n<meta name=\"description\" content=\"Share code between React and React Native to save time, resources, and reduce redundancy by utilizing assets that have already been designed or developed.\" \/>\n<meta name=\"robots\" content=\"noindex, follow\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Sharing Code Between React And React Native - Mobile App Development Services\" \/>\n<meta property=\"og:description\" content=\"Share code between React and React Native to save time, resources, and reduce redundancy by utilizing assets that have already been designed or developed.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/\" \/>\n<meta property=\"og:site_name\" content=\"Mobile App Development Services\" \/>\n<meta property=\"article:published_time\" content=\"2020-01-08T05:05:43+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-09-12T11:29:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2020\/01\/Sharing-code-React-Native-to-React.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1920\" \/>\n\t<meta property=\"og:image:height\" content=\"900\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"msaqlain\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"msaqlain\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/\"},\"author\":{\"name\":\"msaqlain\",\"@id\":\"https:\/\/www.folio3.com\/mobile\/#\/schema\/person\/d7e0ef02800a3f681aaafbd99d7a1c73\"},\"headline\":\"Sharing Code Between React And React Native\",\"datePublished\":\"2020-01-08T05:05:43+00:00\",\"dateModified\":\"2022-09-12T11:29:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/\"},\"wordCount\":498,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.folio3.com\/mobile\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2020\/01\/Sharing-code-React-Native-to-React.jpg\",\"articleSection\":[\"Blog\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/\",\"url\":\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/\",\"name\":\"Sharing Code Between React And React Native - Mobile App Development Services\",\"isPartOf\":{\"@id\":\"https:\/\/www.folio3.com\/mobile\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2020\/01\/Sharing-code-React-Native-to-React.jpg\",\"datePublished\":\"2020-01-08T05:05:43+00:00\",\"dateModified\":\"2022-09-12T11:29:59+00:00\",\"description\":\"Share code between React and React Native to save time, resources, and reduce redundancy by utilizing assets that have already been designed or developed.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/#primaryimage\",\"url\":\"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2020\/01\/Sharing-code-React-Native-to-React.jpg\",\"contentUrl\":\"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2020\/01\/Sharing-code-React-Native-to-React.jpg\",\"width\":1920,\"height\":900,\"caption\":\"Sharing code from React to React Native\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.folio3.com\/mobile\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Sharing Code Between React And React Native\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.folio3.com\/mobile\/#website\",\"url\":\"https:\/\/www.folio3.com\/mobile\/\",\"name\":\"Mobile App Development Services\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/www.folio3.com\/mobile\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.folio3.com\/mobile\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.folio3.com\/mobile\/#organization\",\"name\":\"Mobile App Development Services\",\"url\":\"https:\/\/www.folio3.com\/mobile\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.folio3.com\/mobile\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2020\/12\/folio3-mobile.png\",\"contentUrl\":\"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2020\/12\/folio3-mobile.png\",\"width\":210,\"height\":50,\"caption\":\"Mobile App Development Services\"},\"image\":{\"@id\":\"https:\/\/www.folio3.com\/mobile\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.folio3.com\/mobile\/#\/schema\/person\/d7e0ef02800a3f681aaafbd99d7a1c73\",\"name\":\"msaqlain\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.folio3.com\/mobile\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b06cfd7df7ee148f3c3b752c732984c8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b06cfd7df7ee148f3c3b752c732984c8?s=96&d=mm&r=g\",\"caption\":\"msaqlain\"},\"description\":\"A hardworking and dedicated individual, determined on the road to success, ever ready to take on challenges and accomplish what I set out to achieve.\",\"sameAs\":[\"https:\/\/www.linkedin.com\/in\/msaqlain\/\",\"noc\"],\"url\":\"https:\/\/www.folio3.com\/mobile\/blog\/author\/msaqlain\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Sharing Code Between React And React Native - Mobile App Development Services","description":"Share code between React and React Native to save time, resources, and reduce redundancy by utilizing assets that have already been designed or developed.","robots":{"index":"noindex","follow":"follow"},"og_locale":"en_US","og_type":"article","og_title":"Sharing Code Between React And React Native - Mobile App Development Services","og_description":"Share code between React and React Native to save time, resources, and reduce redundancy by utilizing assets that have already been designed or developed.","og_url":"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/","og_site_name":"Mobile App Development Services","article_published_time":"2020-01-08T05:05:43+00:00","article_modified_time":"2022-09-12T11:29:59+00:00","og_image":[{"width":1920,"height":900,"url":"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2020\/01\/Sharing-code-React-Native-to-React.jpg","type":"image\/jpeg"}],"author":"msaqlain","twitter_card":"summary_large_image","twitter_misc":{"Written by":"msaqlain","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/#article","isPartOf":{"@id":"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/"},"author":{"name":"msaqlain","@id":"https:\/\/www.folio3.com\/mobile\/#\/schema\/person\/d7e0ef02800a3f681aaafbd99d7a1c73"},"headline":"Sharing Code Between React And React Native","datePublished":"2020-01-08T05:05:43+00:00","dateModified":"2022-09-12T11:29:59+00:00","mainEntityOfPage":{"@id":"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/"},"wordCount":498,"commentCount":0,"publisher":{"@id":"https:\/\/www.folio3.com\/mobile\/#organization"},"image":{"@id":"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/#primaryimage"},"thumbnailUrl":"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2020\/01\/Sharing-code-React-Native-to-React.jpg","articleSection":["Blog"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/","url":"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/","name":"Sharing Code Between React And React Native - Mobile App Development Services","isPartOf":{"@id":"https:\/\/www.folio3.com\/mobile\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/#primaryimage"},"image":{"@id":"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/#primaryimage"},"thumbnailUrl":"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2020\/01\/Sharing-code-React-Native-to-React.jpg","datePublished":"2020-01-08T05:05:43+00:00","dateModified":"2022-09-12T11:29:59+00:00","description":"Share code between React and React Native to save time, resources, and reduce redundancy by utilizing assets that have already been designed or developed.","breadcrumb":{"@id":"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/#primaryimage","url":"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2020\/01\/Sharing-code-React-Native-to-React.jpg","contentUrl":"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2020\/01\/Sharing-code-React-Native-to-React.jpg","width":1920,"height":900,"caption":"Sharing code from React to React Native"},{"@type":"BreadcrumbList","@id":"https:\/\/www.folio3.com\/mobile\/blog\/sharing-code-between-react-and-react-native\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.folio3.com\/mobile\/"},{"@type":"ListItem","position":2,"name":"Sharing Code Between React And React Native"}]},{"@type":"WebSite","@id":"https:\/\/www.folio3.com\/mobile\/#website","url":"https:\/\/www.folio3.com\/mobile\/","name":"Mobile App Development Services","description":"","publisher":{"@id":"https:\/\/www.folio3.com\/mobile\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.folio3.com\/mobile\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.folio3.com\/mobile\/#organization","name":"Mobile App Development Services","url":"https:\/\/www.folio3.com\/mobile\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.folio3.com\/mobile\/#\/schema\/logo\/image\/","url":"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2020\/12\/folio3-mobile.png","contentUrl":"https:\/\/www.folio3.com\/mobile\/wp-content\/uploads\/2020\/12\/folio3-mobile.png","width":210,"height":50,"caption":"Mobile App Development Services"},"image":{"@id":"https:\/\/www.folio3.com\/mobile\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.folio3.com\/mobile\/#\/schema\/person\/d7e0ef02800a3f681aaafbd99d7a1c73","name":"msaqlain","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.folio3.com\/mobile\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b06cfd7df7ee148f3c3b752c732984c8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b06cfd7df7ee148f3c3b752c732984c8?s=96&d=mm&r=g","caption":"msaqlain"},"description":"A hardworking and dedicated individual, determined on the road to success, ever ready to take on challenges and accomplish what I set out to achieve.","sameAs":["https:\/\/www.linkedin.com\/in\/msaqlain\/","noc"],"url":"https:\/\/www.folio3.com\/mobile\/blog\/author\/msaqlain\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/www.folio3.com\/mobile\/wp-json\/wp\/v2\/posts\/4311"}],"collection":[{"href":"https:\/\/www.folio3.com\/mobile\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.folio3.com\/mobile\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.folio3.com\/mobile\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/www.folio3.com\/mobile\/wp-json\/wp\/v2\/comments?post=4311"}],"version-history":[{"count":44,"href":"https:\/\/www.folio3.com\/mobile\/wp-json\/wp\/v2\/posts\/4311\/revisions"}],"predecessor-version":[{"id":5751,"href":"https:\/\/www.folio3.com\/mobile\/wp-json\/wp\/v2\/posts\/4311\/revisions\/5751"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.folio3.com\/mobile\/wp-json\/wp\/v2\/media\/4452"}],"wp:attachment":[{"href":"https:\/\/www.folio3.com\/mobile\/wp-json\/wp\/v2\/media?parent=4311"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.folio3.com\/mobile\/wp-json\/wp\/v2\/categories?post=4311"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.folio3.com\/mobile\/wp-json\/wp\/v2\/tags?post=4311"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}