Joshua
Joshua

Reputation: 1393

Lock React Native version in xcode IOS

I have been using React Native for the past 4 of months working both on Android and IOS. According to React Native Docs there will be an updated version of React Native every month. So, I keep updating it every month which is good, but the problem is I am using a couple of npm packages which is getting outdated due to react-native update which in-turn causes errors in my project.

For Android, we can lock the react-native version by specifying the version number in gradle. And for the Javascript part we can lock it in package.json. But for IOS I am not able to find anything like that.

So, is there way to lock the react-native version in IOS xcode?

Upvotes: 1

Views: 535

Answers (1)

Val
Val

Reputation: 22797

Yes, make your package.json file at root path - react-native version to fixed number. for example:

"dependencies": {
    "react-native": "0.50.4",
}

So every time you do npm install, that given version will be installed. without postfix ^ it will never be upgraded.

The react-native version of iOS is just a project / static library import from node_module/react-native/Libraries folder, via react-native link.

Update 1:

Take RCTAnimation.xcodeproj in project for example, you can find it locate at node_modules/react-native/Libraries/NativeAnimation/RCTAnimation.xcodeproj.

enter image description here

Upvotes: 2

Related Questions