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

Doesn't work after updating to React 16.5 #47

Closed
dmlukichev opened this issue Sep 10, 2018 · 2 comments
Closed

Doesn't work after updating to React 16.5 #47

dmlukichev opened this issue Sep 10, 2018 · 2 comments

Comments

@dmlukichev
Copy link

Warning: The <ReactCursorPosition /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change ReactCursorPosition to extend React.Component instead.
Uncaught TypeError: Cannot call a class as a function at _classCallCheck (ReactCursorPosition.js:3)

Problem lies with more strict rules for class call check in latest react version. Because of this old versions of react-cursor-position stopped working work.
They already released new version with fix, but since react-image-magnify uses old one we still have this problem.
Updating dependency will solve this issue.

I hope it will be closed pretty quickly.
Otherwise you can resolve it temporary by directly editing package-lock.json and setting proper version there.

"react-image-magnify": {
      "requires": {
        /* ... */
        "react-cursor-position": "3.0.2",
      },
      "dependencies": {
        /* ... */
        "react-cursor-position": {
          "#todo@dmlukichev": "Remove this after react-image-magnify will update their deps",
          "version": "3.0.2",
          "resolved": "https://registry.npmjs.org/react-cursor-position/-/react-cursor-position-3.0.2.tgz",
          "integrity": "sha512-x6hv5FU9Uo3r8LVcIoF/9V0lLujMFTfvizUO3ExYg/o3+KHv2tGxuq+f4PcurV6AoVPRNFaiXps9ArUNGHAZTA==",
          "requires": {
            "object-assign": "^4.1.1",
            "object.omit": "^3.0.0",
            "prop-types": "^15.6.0"
          }
        }
      }
    },
@ethanselzer
Copy link
Owner

@dmlukichev - Thanks for identifying this issue! A fix is being worked on now. I will post here when it is ready.

@ethanselzer
Copy link
Owner

I think this issue is corrected in version 2.7.1. Please see this CodeSandbox for verification. Thanks!

Closing as fixed by #48. Please reopen if needed.

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

2 participants