Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

undefined is not a function (evaluating 'ReactComponentTreeHook.purgeUnmountedComponents()') #16898

Closed
mbbarrry opened this issue Nov 20, 2017 · 9 comments
Labels
Stale There has been a lack of activity on this issue and it may be closed soon.

Comments

@mbbarrry
Copy link

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

()

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.)

@kckunal2612
Copy link

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

@mbbarrry
Copy link
Author

ok, I will try that.

@mbbarrry
Copy link
Author

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

@kckunal2612
Copy link

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).

@mbbarrry
Copy link
Author

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

@SerafimC
Copy link

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

@vcheban
Copy link

vcheban commented Nov 27, 2017

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.

@naxir
Copy link

naxir commented Dec 20, 2017

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

@stale
Copy link

stale bot commented Feb 18, 2018

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.

@stale stale bot added the Stale There has been a lack of activity on this issue and it may be closed soon. label Feb 18, 2018
@stale stale bot closed this as completed Feb 25, 2018
@facebook facebook locked and limited conversation to collaborators May 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Stale There has been a lack of activity on this issue and it may be closed soon.
Projects
None yet
Development

No branches or pull requests

5 participants