React-Native 0.60+ Exclude library from autolink
Asked Answered
P

1

7

In RN 0.60 we got autolink feature that will link native dependencies at runtime. My question is is there way to exclude some libraries from autolink. I think this can be achived using react-native.config.js file but i haven't found way to do it yet. If there is any example for this it would be great to have it.

Pika answered 27/5, 2020 at 6:48 Comment(0)
G
13

you can ignore auto-linking by adding this code in react-native.config.js at the top level of your RN Project.

module.exports = {
  dependencies: {
    "your_package": {
      platforms: {
        android: null,
        ios: null
        // add more platform to disable auto-linking for them too
      }
    }
  }
}
Gregor answered 27/5, 2020 at 6:56 Comment(3)
Thx :) so in "your_package" i can put what package i want to exclude like for example "react-native-swiper" and it will be turned off ?Pika
yes @Pika + you add multiple dependencies to exclude from auto linkingGregor
Thx :) that's exactly what i needPika

© 2022 - 2024 — McMap. All rights reserved.