Adam Katz
Adam Katz

Reputation: 6972

React Native app work on both ios and android

Making an app to work on both android and ios. For the IOS version I want to use NavigatorIOS and for the android I want to use just Android.
How do I only use the correct navigator depending on the device? Thanks

Upvotes: 0

Views: 187

Answers (1)

John Shammas
John Shammas

Reputation: 2715

You can get the Platform via the React Platform module:

var Platform = require("react-native").Platform;
if (Platform.OS === "ios") { }
else if (Platform.OS === "android") { }

Upvotes: 1

Related Questions