Build the classic five-star rating control as a single React component. The twist that makes it feel real is the hover preview: as the pointer moves across the stars, the fill follows it — and each star splits in half, so hovering the left edge of the third star previews 2.5. Clicking commits that value; moving away shows what you committed.
The starter App.tsx renders five empty stars and "No rating". Make it interactive:
rating and a transient hover, both useState(0). The display value is hover || rating — hover wins while the pointer is over the row, otherwise you see the committed rating.onMouseMove over a star reads the cursor's offsetX: the left half previews i + 0.5, the right half i + 1. Store that in hover.onClick sets rating to the hovered value; onMouseLeave on the row sets hover back to 0.Math.max(0, Math.min(1, value - i)) * 100 percent, and show 3.5 / 5 (or "No rating" when the value is 0) in the label.hover || rating. One derived value drives both the fill and the label. Since a real rating is never 0 once set, hover || rating is a clean "preview beats committed" rule.offsetX. Compare the cursor's offsetX to the star's offsetWidth; under half is .5, over half is a whole star.★ is layered over a grey ☆ and clipped with width — 50% shows a half star. No separate half-star glyph needed.styles.css; focus on the state and the offset math.