1

I'm working on a project where it is needed to add an specific dependency for a feature on iOS and i would like to avoid to include this library in the android bundle. Is it possible? It isn´t a response to change the name of the android or ios project and run 'react-native link' ;)

The library is react-native-text-detector

Makx
  • 21
  • 6

1 Answers1

0

I'm not sure if this answers your question but you could do something like

let textDetector;

if(Platform.OS === "ios"){
    textDetector = require("react-native-text-detector");
}

And then when you use it just make sure to check if it is not undefined

Nemi Shah
  • 856
  • 1
  • 7
  • 11