I am currently using the react-native-safari-view module in my React Native project to display web views in iOS.
Since the module is not yet implemented for Android, when I try to create a project for Android, it gives me an error in this line:
import SafariView from 'react-native-safari-view'
I am going to use the Linking library for Android, but I do not know how to use the same code for two platforms.
I tried:
if (Platform.OS == 'ios') { import SafariView from 'react-native-safari-view' }
And this gives me this error:
import 'and' export 'can only be displayed at the top level
How do I get around this?
android ios react-native
user6632504
source share