stars-rating-react-hooks
Advanced tools
Comparing version 0.2.0 to 0.2.1
{ | ||
"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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
794
0