Skip to content

Instantly share code, notes, and snippets.

@RusAlex
Forked from jmarceli/README.md
Last active January 27, 2016 06:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RusAlex/b6b33eb5f2e32fc6a31d to your computer and use it in GitHub Desktop.
Save RusAlex/b6b33eb5f2e32fc6a31d to your computer and use it in GitHub Desktop.
React errors explained

1

You will get one of these:

Uncaught (in promise) TypeError: Cannot read property 'toUpperCase' of undefined(…)

ReactCompositeComponent.js:870 Uncaught TypeError: Cannot read property 'displayName' of undefined

if you try to:

import { ComponentName } from 'ComponentName.jsx'

instead of:

import ComponentName from 'ComponentName.jsx'

2

This error:

Uncaught TypeError: Cannot read property 'toUpperCase' of undefined

might be caused by importing:

import { Link } from 'redux-router'

instead of

import { Link } from 'react-router'

3

Performance problems might be caused by 'redux-logger' and 'redux-devtools' packages.

Remove them from production build!

4

This error:

Uncaught TypeError: Cannot read property 'displayName' of undefined
      at Array.forEach (native)

When you try to render an array of items with map callback:

{items.map(renderItem)}

You have to wrap the rendered result into <div></div> tag.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment