ninjasort / react-star-rating

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

Uncaught Invariant Violation When trying to render component #35

Open jasmo2 opened 8 years ago

jasmo2 commented 8 years ago

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>
  )}
}
priyanshuchauhan commented 8 years ago

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

benbristow commented 6 years ago

Same issue here

Dsantacruz commented 6 years ago

Same issue here, any solution??

ninjasort commented 6 years ago

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?