dont render 0
This commit is contained in:
@@ -52,6 +52,8 @@ export function CountWheel({
|
||||
|
||||
const [prevCount, setPrevCount] = React.useState(likeCount)
|
||||
const prevIsLiked = React.useRef(isLiked)
|
||||
const formattedCount = formatCount(likeCount)
|
||||
const formattedPrevCount = formatCount(prevCount)
|
||||
|
||||
React.useEffect(() => {
|
||||
if (isLiked === prevIsLiked.current) {
|
||||
@@ -73,12 +75,12 @@ export function CountWheel({
|
||||
prevIsLiked.current = isLiked
|
||||
}, [isLiked, likeCount, shouldAnimate, shouldRoll])
|
||||
|
||||
const formattedCount = formatCount(likeCount)
|
||||
const formattedPrevCount = formatCount(prevCount)
|
||||
if (likeCount < 1) {
|
||||
return null
|
||||
}
|
||||
|
||||
return (
|
||||
<View>
|
||||
{likeCount > 0 ? (
|
||||
<View
|
||||
aria-disabled={true}
|
||||
// @ts-expect-error is div
|
||||
@@ -95,7 +97,6 @@ export function CountWheel({
|
||||
{formattedCount}
|
||||
</Text>
|
||||
</View>
|
||||
) : null}
|
||||
<View
|
||||
style={{position: 'absolute'}}
|
||||
aria-disabled={true}
|
||||
|
||||
Reference in New Issue
Block a user