简体   繁体   中英

Create own dependency in react native for iOS

I'm creating first react-native dependency for both android and iOS. I have done coding part for android but now I'm stuck in iOS. Where to write code for my library and how to test.

React Native uses CocoaPods to manage iOS project dependencies and most React Native libraries follow this same convention.

Run pod install in our ios directory in order to link it to our native iOS project. A shortcut for doing this without switching to the ios directory is to run npx pod-install. Once this is complete, re-build the app binary to start using your new library: npx react-native run-ios.

For testing the code you could use Jest testing framework. go onto the ReactNative for more guidance.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM