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

Module not found

Open mRcSchwering opened this issue 5 years ago • 3 comments

Is anyone having problems installing the package? I am getting Module not found: Can't resolve './react-star-ratings'.... I cleared and reinstalled node modules.

using yarn 1.22.5

mRcSchwering avatar Apr 19 '21 09:04 mRcSchwering

Had the same issue, just change './react-star-ratings' to 'react-star-ratings' !

MargVander avatar May 06 '21 15:05 MargVander

@MargVander I changed 'react-star-ratings' to './react-star-ratings' but now not I can't find the Library

Sid6022 avatar May 06 '21 17:05 Sid6022

Thanks @MargVander This worked for me import StarRatings from 'react-star-ratings';

Example with Hooks

const [ rating, setRating ] = useState(2);

return (
          <StarRatings
            rating={rating}
            starRatedColor="blue"
            changeRating={(newRating) => setRating( newRating )}
            numberOfStars={5}
            name='rating'
          />
          )

imranhsayed avatar May 10 '21 11:05 imranhsayed