React-native: undefined is not a function (evaluating 'ReactComponentTreeHook.purgeUnmountedComponents()')

Created on 20 Nov 2017  路  9Comments  路  Source: facebook/react-native

Is this a bug report?

(I don't know but it seems to be)

Have you read the Contributing Guidelines?

(Yes)

Environment

Steps to Reproduce

()

1.
2.
3.

Expected Behavior

(Write what you thought would happen.)

Actual Behavior

(I deleted the node_module then i installed used the npm install after i run the app using react-native run-android then i got the error
screenshot_1511190209
)

Reproducible Demo

(Paste the link to an example project and exact instructions to reproduce the issue.)

Stale

Most helpful comment

Hello guys.
I've found solution to this problem:

https://reformatcode.com/code/ios/react-native---reactcomponenttreehookpurgeunmountedcomponents-is-not-a-function

In the end, I figured that the versions of react and react-native packages that I were installed didn't "match". I saw the message npm WARN [email protected] requires a peer of [email protected] but none was installed. (I had a previous version installed because of another warning that I got).

As soon as I installed [email protected] instead, the problem was solved. Apparently facebook has removed the function ReactComponentTreeHook.purgeUnmountedComponents from the code, it is not to be used

It helped me too.
Good luck.

All 9 comments

Even I had this issue. Fixed it by updating my 'react-native' version to '0.50'.

ok, I will try that.

@kckunal2612 how can I update my react-native? a command please

In your project's root directory, there would be a "package.json" file. In there, there would be a dependencies block like this -

"dependencies": {
...
react-native": "^0.50.3",
...
}

In case you don't have version 0.50 here, you can change the version value for 'react-native' and then run the command 'npm-update' from the terminal. This will update the node-modules directory as well (update contents for this module).

ok
I have also tried this " npm install -git react-native-git-upgrade"
but i am having this warning
"git-upgrade WARN The upgrade process succeeded but there might be conflicts to be resolved. See above for the list of files that have merge conflicts.
git-upgrade info Upgrade done"
and had some errors
error: patch failed: android/app/build.gradle:72
Falling back to three-way merge...
Applied patch to 'android/app/build.gradle' cleanly.
error: patch failed: android/app/src/main/java/com/taximoto/MainApplication.java:25
Falling back to three-way merge...
Applied patch to 'android/app/src/main/java/com/taximoto/MainApplication.java' cleanly.
error: patch failed: ios/TaxiMoto.xcodeproj/project.pbxproj:36
Falling back to three-way merge...
Applied patch to 'ios/TaxiMoto.xcodeproj/project.pbxproj' with conflicts.
U ios/TaxiMoto.xcodeproj/project.pbxproj
any help with this

Got the same error here.
Already tried to update React, react native, all packages and npm but
it dont work:
undefined is not a function (evaluating 'ReactComponentTreeHook.purgeUnmountedComponents()')

I'll keep up and any news I bring here

Hello guys.
I've found solution to this problem:

https://reformatcode.com/code/ios/react-native---reactcomponenttreehookpurgeunmountedcomponents-is-not-a-function

In the end, I figured that the versions of react and react-native packages that I were installed didn't "match". I saw the message npm WARN [email protected] requires a peer of [email protected] but none was installed. (I had a previous version installed because of another warning that I got).

As soon as I installed [email protected] instead, the problem was solved. Apparently facebook has removed the function ReactComponentTreeHook.purgeUnmountedComponents from the code, it is not to be used

It helped me too.
Good luck.

I was facing the same issue after going to react-native version 0.50 issue resolved
Thanks @kckunal2612

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

aniss picture aniss  路  3Comments

DreySkee picture DreySkee  路  3Comments

despairblue picture despairblue  路  3Comments

lazywei picture lazywei  路  3Comments

ghost picture ghost  路  3Comments