React Native - ReactComponentTreeHook.purgeUnmountedComponents不是函数

问题描述 投票:6回答:1

当我使用react-native run-ios或仅为iOS构建时,我收到此错误消息:

ReactComponentTreeHook.purgeUnmountedComponents is not a function. (In 'ReactComponentTreeHook.purgeUnountedComponents()', 'ReacComponentTreeHook.purgeUnmountedComponents' is undefined)

我用CRNA并弹出。我也使用过react-native-push-notificationreact-native-beacons-manager,并按照两者的说明进行操作。当我在Android中运行它时,该项目有效。

我读过here,这取决于我使用react的缩小版本和react-dom的未经编辑的版本,但我不知道在React Native中我可以改变它的位置。

我该如何解决这个问题?

javascript reactjs react-native
1个回答
7
投票

最后,我认为我安装的reactreact-native软件包的版本没有“匹配”。我看到了消息npm WARN [email protected] requires a peer of [email protected] but none was installed.(由于我得到了另一个警告,我安装了以前的版本)。

一旦我安装了[email protected],问题就解决了。显然facebook已从代码中删除了函数ReactComponentTreeHook.purgeUnmountedComponents,它不再被使用了。

© www.soinside.com 2019 - 2024. All rights reserved.