Can I require a module specifically for iOS in React Native? : <p>I am currently using <a href="https://github.com/naoufal/react-native-safari-view" rel="noreferrer"><code>react-native-safari-view</code></a> module in my React Native project for showing web views in iOS.</p>

<p>As the module is not yet implemented for Android, when I try to build the project for Android, it gives me an error at this line:</p>

<pre><code>import SafariView from 'react-native-safari-view'
</code></pre>

<p>I am going to use the <a href="https://facebook.github.io/react-native/docs/linking.html" rel="noreferrer"><code>Linking</code></a> library for Android, but I don't know how to use the same code for two platforms.</p>

<p>I tried:</p>

<pre><code>if (Platform.OS == 'ios') {
    import SafariView from 'react-native-safari-view'
}
</code></pre>

<p>And it gives me this error:</p>

<blockquote>
  <p>import' and 'export' may only appear at the top level</p>
</blockquote>

<p>How do I get around this?</p>
