ertanhasani / react-stars

A simple star rating component for your React projects :star:
70 stars 13 forks source link

Uncaught (in promise) TypeError: (0 , _react.useState) is not a function #19

Open HarshitGupta20 opened 3 years ago

HarshitGupta20 commented 3 years ago

I am trying to use import ReactStars from "react-rating-stars-component"; However, I am getting the below error and Starts are not getting rendered.

_Uncaught (in promise) TypeError: (0 , react.useState) is not a function at ReactStars (react-stars.js:41)

I am using: "react": "15.4.2", "react-color": "^2.17.3", "react-dom": "15.4.2", "react-rating-stars-component": "^2.2.0",

Please help me asap. On a deadline.

alex7229 commented 2 years ago

This project uses hooks, which are not available in the react v 15.

From react docs: React 16.8.0 is the first release to support Hooks. When upgrading, don’t forget to update all packages, including React DOM.