Open manueldho opened 4 years ago
Right now there is no way to actually reset the value. I added it as a feature request, and I or someone else will try to implement it. Here's the feature request if you wanna stay on the loop.
As a temporary solution you could be able to do something like:
const [starsKey, setStarsKey] = useState(Math.random());
const clearForm = () => {
setStarsKey(Math.random()); //this will generate a random number, which will cause the ReactStars component to be re rendered
setRatings('');
setSuggestions('');
console.log(ratedstars,'ratedstars---------------------------------------')
}
return (
<ReactStars
key={starsKey}
...otherProps
/>
);
export const FeedbackPage = () => {
}