From 23a724b7366019fe2c0300bc75643c44959aeac7 Mon Sep 17 00:00:00 2001 From: Angelos Chalaris Date: Thu, 18 Oct 2018 14:37:12 +0300 Subject: [PATCH] Update StarRating.md --- snippets/StarRating.md | 2 -- 1 file changed, 2 deletions(-) diff --git a/snippets/StarRating.md b/snippets/StarRating.md index 44e01e1d9..472d60080 100644 --- a/snippets/StarRating.md +++ b/snippets/StarRating.md @@ -5,8 +5,6 @@ Renders a star rating component. Use the value of the `rating` prop to determine if a valid rating is supplied and store it in `state.rating` (or `0` if invalid or not supplied). Initialize `state.selection` to `0`. Create two methods, `hoverOver` and `setRating`, that take a number as argument and update `state.selected` and `state.rating` according to it, bind them both to the component's context. - - In the `render()` method, define a functional component, called `Star` that will render each individual star with the appropriate appearance, based on the parent component's `state`, and handle its `onMouseEnter` and `onClick` events, using the parent component's `hoverOver` and `setRating` methods. Render a `
` to wrap the `` components, which are created using `Array.prototype.map` on an array of 5 elements, created using `Array.from`, and handle the `onMouseLeave` event to set `state.selection` to `0`. Finally, pass the appropriate values to each `` component (`starId`, `marked`, `onHover` and `setRating`).