React Native:你必须为 AsyncStorage 做手动链接吗?

React Native: do you have to do manual linking for AsyncStorage?

我正在关注 this guide 将 AsyncStorage 添加到我的 React Native 应用程序。我使用的是 react native v0.63.4,但我使用的是 Mac,所以我想知道他们在底部引用 MacOS 的手动链接是否是某种东西我要做。例如,在手动链接指南中,它说要在您的 podfile 中为 AsyncStorage 添加一行,而当我刚刚执行 npm i...pod install 时,我的 podfile 中没有添加任何行。我是否必须执行此手动链接?

您不必进行手动链接。从 React Native 的 0.60 版本开始,它发布了一个名为 autolinking 的特性。也就是说,当你执行 npm installyarn add 时,lib 已经链接,pod install 只是在幕后安装依赖项,它不一定非要在 podfile 中。