ninjasort / react-star-rating

[Looking for Maintainers (email me)]: A simple star rating component built with React.
MIT License
173 stars 58 forks source link

Uncaught TypeError: Cannot read property 'getBoundingClientRect' of undefined #36

Open alfredlam42 opened 7 years ago

alfredlam42 commented 7 years ago

I just copy and pasted the example code provided to test out before putting it in my project, but every time I click a star, the error pops up. I've read somewhere that this happens because it can't find the element on the dom.

Also, when I add the component four times to get four rows of stars, this error only shows up when I click the first row. No error shows up when I click the other rows, but it still doesn't change the star rating.

Any suggestions on what to do?

seenickcode commented 7 years ago

Any update on this? @alfredlam42 were you able to fix this?

ninjasort commented 7 years ago

Hi @alfredlam42, sorry for the delay. Have been massively busy. I'll take another look at this over weekend.

ctrlaltdylan commented 7 years ago

Also getting the same error as described - not sure if it helps but I also have this error just on render:

 invariant.js?4599:44 Uncaught Error: addComponentAsRefTo(...): Only a ReactOwner can have refs. You might be adding a ref to a component that was not created inside a component's `render` method, or you have multiple copies of React loaded (details: https://fb.me/react-refs-must-have-owner).
at invariant (eval at <anonymous> (bundle.js:792), <anonymous>:44:15)
at Object.addComponentAsRefTo (eval at <anonymous> (bundle.js:1140), <anonymous>:68:68)
at attachRef (eval at <anonymous> (bundle.js:1134), <anonymous>:23:16)
at Object.ReactRef.attachRefs (eval at <anonymous> (bundle.js:1134), <anonymous>:42:5)
at ReactDOMComponent.attachRefs (eval at <anonymous> (bundle.js:1128), <anonymous>:23:12)
at CallbackQueue.notifyAll (eval at <anonymous> (bundle.js:1158), <anonymous>:76:22)
at ReactReconcileTransaction.close (eval at <anonymous> (bundle.js:1626), <anonymous>:80:26)
at ReactReconcileTransaction.closeAll (eval at <anonymous> (bundle.js:1170), <anonymous>:206:25)
at ReactReconcileTransaction.perform (eval at <anonymous> (bundle.js:1170), <anonymous>:153:16)
at ReactUpdatesFlushTransaction.perform (eval at <anonymous> (bundle.js:1170), <anonymous>:140:20)