title: Cross-platform React Native file structure
body: <p>I'm coming from Ionic 2 where I write my code once, and it runs everywhere. </p>
  
  <p>According to this page <a href="https://facebook.github.io/react-native/docs/platform-specific-code.html" rel="nofollow">https://facebook.github.io/react-native/docs/platform-specific-code.html</a> "When building a cross-platform app, you'll want to re-use as much code as possible."</p>
  
  <p>How can I "reuse" code across iOS and Android in ReactNative? In the starter app I see two files: index.ios.js and index.android.js. Is there something like index.js that I can use for sharing across platforms? </p>
  
  <p>It seems like there should be one file for shareable code, since that web page mentioned above also shows how you can use the Platform module to check what OS you are on. </p>
  
  <p>I realize that sometimes you need different behavior on different platforms, but, assuming that my app is simple enough, and my code ends up exactly the same on both platforms, do I have to copy/paste from one to the other? How can I pull same-functionality into it’s own file to be shared on both platforms?</p>
  
  <p>What am I missing?</p>
  
  <p>Thanks!</p>