question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught TypeError: Cannot read property 'ReactCurrentOwner' of undefined

See original GitHub issue

I’m new to React Motion, and spent all day yesterday trying to get what I need. However, I can’t figure out what has caused this issue

Uncaught TypeError: Cannot read property 'ReactCurrentOwner' of undefined

I’ve been playing around with the demos and currently this is what I have. If this is not enough code, please let me know!

  getStyles() {
    const endValue = this.state;
    return [endValue];
  },

  render() {
    return (
      <TransitionMotion
        styles={ this.getStyles }
        willEnter={() => null}
        willLeave={() => null}>
        {ball =>
          <div className="demo1">
            <div
              key="demo1"
              className={`demo1-ball ball-0`}
              style={{
                WebkitTransform: `translate3d(${ball[0].x - 25}px, ${ball[0].y + 25}px, 0)`,
                transform: `translate3d(${ball[0].x - 28}px, ${ball[0].y - 54}px, 0)`,
              }} />
            )}
          </div>
        }
      </TransitionMotion>
    );
  },

What is causing the error?

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:16
  • Comments:24

github_iconTop GitHub Comments

34reactions
msandcommented, May 2, 2017

Try deleting your node_modules folder and run yarn or npm install again, then rerun your build process / file watcher.

This error might happen if two separate versions of react-dom are loaded, e.g., by oneself (index.js) and another dependency (react-apollo) on the server side when used for SSR. Are you trying to render react-motion on the server side?

29reactions
RobertApeliancommented, Nov 2, 2017

I also had the problem with React 15 and jest, but updating to 16 was not an option. Downgrading react-test-renderer to ^15 worked though.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Cannot read property 'ReactCurrentOwner' of undefined ...
TypeError : Cannot read property 'ReactCurrentOwner' of undefined. The error does not seem to be caused by my code, but either by ...
Read more >
Cannot read property 'ReactCurrentOwner' of undefined #83
It is a global npm module that can be used to update your dependencies, such as react or react-dom, in your package.json file....
Read more >
Unit tests - Mattermost Developers
If you get an error like UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'filter' of undefined. Check if the code being tested used native ...
Read more >
How to Read React Errors (fix 'Cannot read property of ...
This error usually means you're trying to use .map on an array, but that array isn't defined yet. That's often because the array...
Read more >
Cannot read property 'ReactCurrentOwner' of undefined ...
Coding example for the question TypeError: Cannot read property 'ReactCurrentOwner' of undefined-React Native.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found