-
test using baisc zustand implementation with nextjs 14: export function CounterDisplay() {
const { count } = useStore();
return (
<div className="flex items-center justify-center rounded-lg p-1 text-2xl">
<NumberFlow
willChange
aria-hidden
trend={true}
value={count}
className="pointer-events-none"
/>
</div>
);
} bug recreation codesandbox demo: https://codesandbox.io/p/devbox/pk6p4q The problem I just encountered with the newest package "0.2.5" was the inconsistency of the default trend. It shows correct up or down when the number is increasing or otherwise when the number is positive, however whenever the number is negative the trend seems break. Recording.2024-10-23.223840.mp4 |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 5 replies
-
Hi 👋, thanks for the sandbox. Here's a quick fork that I think is more what you're looking for? I wasn't sure how to handle this case in the core package because I feel like it doesn't generalize, but I'm open to suggestions. |
Beta Was this translation helpful? Give feedback.
-
I appreciate and 100% love the efficiency you got! The implementation is very nice and it seems like it's something that the trend should be to me, while I might adjust the direction inversely for negatives for a more natural feeling. |
Beta Was this translation helpful? Give feedback.
-
Sweet! I'll think about what an API for this could look like and leave this open as a discussion for visibility 👋 |
Beta Was this translation helpful? Give feedback.
-
I just pushed an update which should simplify this. You can now add the prop:
to get this behavior. |
Beta Was this translation helpful? Give feedback.
I just pushed an update which should simplify this. You can now add the prop:
to get this behavior.