-
-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Description
"rr--on" is not added during hover if itemStyles is used. If you do not specify itemStyles, then everything works correctly.
v1.5.0
import { useState } from 'react';
import { Rating, ThinStar } from '@smastrom/react-rating';
function App() {
const [rating, setRating] = useState(0);
const [hover, setHover] = useState(0);
function onChange(newValue: number) {
console.log(newValue);
setRating(newValue);
}
const myStyles = {
itemShapes: ThinStar,
activeFillColor: '#ffb700',
inactiveFillColor: '#fbf1a9',
};
return (
<div className="App">
<Rating
style={{ maxWidth: 180 }}
value={rating}
onChange={onChange}
onHoverChange={setHover}
itemStyles={myStyles}
/>
{hover}
</div>
);
}
export default App;
Metadata
Metadata
Assignees
Labels
No labels