Show Buttons
Share On Facebook
Share On Twitter
Share On Google Plus
Share On Linkdin
Share On Reddit
Share On Stumbleupon
Contact us
Hide Buttons

Uncaught TypeError: Cannot read property ‘toUpperCase’ of undefined in React

Ok, I gotta admit this is a really annoy­ing issue because its root cause is pretty trivial.

You get this issue in React when

You are acci­den­tally try­ing to ren­der a com­po­nent and that com­po­nent itself is null or unde­fined. e.g you are try­ing to ren­der <MyComponent /> when the value of MyComponent is itself null or undefined.

Ive encoun­tered this issue sev­eral times, the most recent being when upgrad­ing to react-router 1.0 release can­di­date which elim­i­nated the the <RouteHandler /> com­po­nent. As a result, at places in my tree where I was doing a require for RouteHandler, things worked because it sim­ply returned unde­fiend, but the moment I tried to ren­der it using <RouteHandler /> React gave me this pretty lit­tle error.

Hope this helps you save some pro­duc­tive time!