-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I got an error when I use flipTo
function in a 'react' project
#25
Comments
I think this will work: const FlipNumber = ({ number: realNumber }) => {
const ref = useRef();
const flipRef = useRef(null);
useEffect(() => {
flipRef.current = new Flip({
node: ref.current,
from: 0,
to: realNumber,
duration: 1.5,
separator: ","
});
}, []);
useEffect(() => {
flipRef.current.flipTo({ to: realNumber });
}, [realNumber]);
return <div ref={ref} />;
}; |
Yeah. It does work in my 'vite' demo project but I failed in my production project, which meas it may be an incompatibility problem. Forget it. Thanks very much for your reply ! |
any updated? |
@gaoryrt still error... |
|
似乎是数字位数不一样,所以提示 Cannot read properties of undefined (reading 'childNodes') |
my react component code:
The text was updated successfully, but these errors were encountered: