当我使用react-native run-ios
或仅为iOS构建时,我收到此错误消息:
ReactComponentTreeHook.purgeUnmountedComponents is not a function. (In 'ReactComponentTreeHook.purgeUnountedComponents()', 'ReacComponentTreeHook.purgeUnmountedComponents' is undefined)
我用CRNA并弹出。我也使用过react-native-push-notification
和react-native-beacons-manager
,并按照两者的说明进行操作。当我在Android中运行它时,该项目有效。
我读过here,这取决于我使用react
的缩小版本和react-dom
的未经编辑的版本,但我不知道在React Native中我可以改变它的位置。
我该如何解决这个问题?
最后,我认为我安装的react
和react-native
软件包的版本没有“匹配”。我看到了消息npm WARN [email protected] requires a peer of [email protected] but none was installed.
(由于我得到了另一个警告,我安装了以前的版本)。
一旦我安装了[email protected]
,问题就解决了。显然facebook已从代码中删除了函数ReactComponentTreeHook.purgeUnmountedComponents
,它不再被使用了。