title: How can different apps import from a shared components folder? react / react-native
body: <p>I'm currently working on a project where we have to make 2 mobile apps. We decided to build those apps with react-native, so we can take advantage of the cross platform functionality.</p>
  
  <p>Then we outlined the project structure. In the UI design of both apps, most of the components are exactly the same, but only a change in color.</p>
  
  <p>So that's why we've decided that both apps must import (flexible) components from <strong>one folder</strong>.</p>
  
  <p><em>Project Structure</em></p>
  
  <pre><code>- mobile
      - project 1
      - project 2
  </code></pre>
  
  <p><em>Must look something like one off the two solutions below</em></p>
  
  <pre><code>- components
  - mobile
      - project 1
      - project 2
  </code></pre>
  
  <p>or</p>
  
  <pre><code>- mobile
      - components
      - project 1
      - project 2
  </code></pre>
  
  <p>'</p>
  
  <p><strong>The problem</strong></p>
  
  <p>So the problem occurs when I try to import the components from outside either the project 1 or 2. For example, I created a Loading component usable for both projects (apps). But this component uses a third-party library, and that library requires a Pod install, to install some additional libraries.</p>
  
  <p>Questions:</p>
  
  <ol>
  <li>Where should I install the third party library (yarn add). In the folder components, or in both project folders?</li>
  <li>If I install it in the components folder, I am not able to run Pod install, since there was nothing added inside that project directory.</li>
  <li>If I try to import a component from the components folder, which is outside the project directory, I'am getting 'Unable to resolve module..' error.</li>
  </ol>
  
  <p>I think that react-native is not encouraging that we should import components from outside the project directory, hence the error. But still, I want this to work, so it would be better organised and way more efficient.</p>
  
  <p>Does someone have experience in this type of field? <strong>How can a I solve this issue? What are the possible solution(s)</strong>.</p>
  
  <p><em>I've read other StackOverflow posts, but still couldn't figure it out. It is still not clear to me.</em></p>