stars-rating-react-hooks
Advanced tools
Comparing version
{ | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"license": "MIT", | ||
@@ -4,0 +4,0 @@ "main": "dist/index.js", |
@@ -54,18 +54,21 @@ import React, { HtmlHTMLAttributes } from 'react'; | ||
const stars: Array<Renderable> = Array.from(Array(totalStars), (_, i: number) => { | ||
const shouldRenderHalf = renderHalf !== null ? true : false; | ||
let sindex = shouldRenderHalf ? i + 0.5 : i + 1; | ||
const stars: Array<Renderable> = Array.from( | ||
Array(totalStars), | ||
(_, i: number) => { | ||
const shouldRenderHalf = renderHalf !== null ? true : false; | ||
let sindex = shouldRenderHalf ? i + 0.5 : i + 1; | ||
const isSelected = sindex <= selectingValue; | ||
const isHalf = | ||
!Number.isInteger(selectingValue) && sindex === selectingValue; | ||
const isSelected = sindex <= selectingValue; | ||
const isHalf = | ||
!Number.isInteger(selectingValue) && sindex === selectingValue; | ||
const render = isSelected | ||
? isHalf | ||
? renderHalf | ||
: renderFull | ||
: renderEmpty; | ||
const render = isSelected | ||
? isHalf | ||
? renderHalf | ||
: renderFull | ||
: renderEmpty; | ||
return render; | ||
}); | ||
return render; | ||
} | ||
); | ||
@@ -72,0 +75,0 @@ function getStarProps(index: number, elementProps?: any) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
76241
0.37%794
0.38%0
-100%