title: Compile different code blocks for ios and android on react native
body: <p>I have read <a href="https://facebook.github.io/react-native/docs/platform-specific-code" rel="nofollow noreferrer">this</a> article in react native documentation. My question is how can I compile the js bundle differently for android and ios?</p>
  
  <p>For example let's say I want to add a few lines of code for iOS inside a function. According to the mentioned article, I have to either use <code>Platform.OS</code> and check the platform on runtime or use .ios.js and .android.js files and let webpack use the correct static file.
  The problem with the first approach is it may make the bundle big (if we have lots of these situations and the codes are big enough) and the problem with the second approach is that if the difference is not much for every change for the common code between the platform I have to change 2 files!</p>
  
  <p>Isn't there any way to have a hybrid approach to consider platform specific code blocks while creating the bundle?</p>