react-star-rating icon indicating copy to clipboard operation
react-star-rating copied to clipboard

Uncaught Invariant Violation When trying to render component

Open jasmo2 opened this issue 8 years ago • 4 comments

I am trying to add the component inside my div buy I get the nex message:

Uncaught Invariant Violation: 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).

here is an example:

import React, {Component} from 'react';
import ReactDOM from 'react-dom';
import { connect } from 'react-redux';
import StarRating from 'react-star-rating'


class IndexContent extends Component{
  render(){
    return(
      <div className="index-content">

          <StarRating name="small-rating" caption="" size={10} totalStars={5} rating={3} />

      </div>
  )}
}

jasmo2 avatar Sep 29 '16 02:09 jasmo2

I'm also facing the same issue. Probably it's trying to load react twice but I gave up on this for now. You can try this one https://github.com/voronianski/react-star-rating-component. It worked for me

priyanshuchauhan avatar Oct 03 '16 11:10 priyanshuchauhan

Same issue here

benbristow avatar Feb 26 '18 14:02 benbristow

Same issue here, any solution??

Dsantacruz avatar Jul 31 '18 22:07 Dsantacruz

Sorry guys. I am not available to work on this at the moment. Would anyone like to be added as a contributor and help with the project?

ninjasort avatar Aug 02 '18 15:08 ninjasort