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

Does not work with React 16 #342

Closed
bradennapier opened this issue Sep 26, 2017 · 9 comments
Closed

Does not work with React 16 #342

bradennapier opened this issue Sep 26, 2017 · 9 comments

Comments

@bradennapier
Copy link

This package breaks any app using it once updated to React 16


ReactBaseClasses.js:66 Uncaught TypeError: this.updater.enqueueCallback is not a function
    at ReactTooltip.ReactComponent.setState (ReactBaseClasses.js:66)
    at resetState (index.js:436)
    at ReactTooltip.hideTooltip (index.js:448)
@emplums
Copy link

emplums commented Oct 3, 2017

heya @bradennapier did you end up finding a work around for this? I saw your comment in the React repo!

@bradennapier
Copy link
Author

Hey @emily-plummer this happens when you have two versions of React installed. This was due to a repo which I was not even including but since it was in my package.json it was causing an issue.

yarn list

revealed that repo easily and upon removing it this problem instantly resolved. So it was not an issue with react-tooltip at all.

That being said, I will leave this open for a little while so others can see it -s ince we have 7 thumbs up already I would assume quite a few are running into this!

@jordmccord
Copy link

I've been running the plugin in production for over a week now and had no problems...

@bradennapier
Copy link
Author

Correct, you will not have problems unless there is a module that has React < 16 in its dependencies rather than peerDependencies where it should be.

@emplums
Copy link

emplums commented Oct 3, 2017

Rad! Thanks @bradennapier :)

@iamthesiz
Copy link

Wait.. so what was this fix? Moving react in package.json of ReactTooltip to peerDependencies??

@bradennapier
Copy link
Author

bradennapier commented Oct 4, 2017

No, it wasnt react-tooltip that was the problem, if ANY of your dependencies or their dependencies have react as a dependency rather than peerDependency then any calls that utilize enqueue callback

this.setState({
    foo: 'bar'
}, () => console.log('set!'))

will generate this error.

if you run the

yarn list 

or

npm ls 

on your app you should see a package that has react as a dependency -- that package needs to move it to peerDependencies or you need to remove that package. Even if you do not use that package and it is never imported - it appears to cause a conflict.

@jonricaurte
Copy link

@wwayne
Copy link
Collaborator

wwayne commented Oct 16, 2017

Merged and deployed as 3.4.0

@wwayne wwayne closed this as completed Oct 16, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants