S
S
SuperDoker2017-03-13 18:50:16
React
SuperDoker, 2017-03-13 18:50:16

What kind of error is so interesting?

Everything works
here codepen.io/bradwestfall/pen/reaWYL
But not here
prntscr.com/ejg93i
prntscr.com/ejg9ay
In script.js the same code as on codepen

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
Nick8, 2017-03-13
@Nick8

Probably, at the time of accessing the props or some property, it has not yet been transferred. Maybe something comes from the base or something like that

M
Maxim, 2017-03-13
@maxfarseer

According to the screenshots, I can only translate:
There is no way to read the location, which was read from some variable .. and you did not pass this variable.
Further, if you look at the codePen, there is a comment:
// Note that with how CodePen works, I wasn't able to get the browserHistory to work
// as the article suggests. The demo works without it, but you'll want to be sure to
// use it in a real application

Which says that browserHistory is not connected here (on the codepen)... Putting it
together, most likely, you need it, so how location was read directly from it or from somewhere ...
There is no variable (it means undefined instead), it means js is trying to execute
Which returns an error.

A
abberati, 2017-03-14
@abberati

Cannot read propery location of 'undefined' - react.min.js file

the field locationis in the object window.
at the time of the script execution (which you placed in <head></head>), <body></body>it has not yet been parsed, which means that the DOM has not been initialized. and this implies that window === undefined.
the solution is to put ps script.jsin the last line <body></body>
: if you get into the source codes of the codepen through devtools, you will notice that everything is connected there according to the mind.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question