reactjsjsbin

"Can't read property call of undefined" error on JSBin?


I am trying to learn React using JSBin. I have simple example code BookList and BookInfo (renders items inside BookList).

http://jsbin.com/hoyeroz/2/edit?js,output

I am getting below error in the console:enter image description here

Uncaught TypeError: Cannot read property 'call' of undefined

Is this a JSBin bug or am I declaring the React components incorrectly?


Solution

  • Your code is proper, and working also, don't know why it is not working on JSBin, because same code is giving proper output on jsfiddle.

    check fiddle: https://jsfiddle.net/03Lm3zbv/

    Update: After doing some Google search finally got this:

    This is a bug with JSBin, and how it handles transpilation with Babel. If you add the pragma //noprotect to the top of your code it will work.

    check the working code on JSBin: http://jsbin.com/gedavinodu/edit?html,js,output