Comments (1)
To make the animation works we just need to implement also the clean up function, which is anyway a best practice!
useEffect(() => {
setOdometerValue(300);
const interval = setInterval(() => {
setOdometerValue((value) => value + 300);
}, 20000);
return () => clearInterval(interval);
}, []);
Hope this helps others!
from react-odometerjs.
Related Issues (20)
- react native support? HOT 1
- how can i use toLocaleString....??? HOT 4
- Move the underlying Odometer.js to a maintained fork
- Should be able to change font on specific "Odometer" call HOT 1
- Need a better example... HOT 2
- format not working as expected - or perhaps I am dumb HOT 6
- Does not work with Next.js
- uration
- Duration always default HOT 1
- Breaks Gatsby build
- Can't use the lib with Typescript HOT 1
- unable to resolve dependency tree HOT 2
- Odometer js not working with Next js ( It is very sad)
- React-Odometer.js Doesn't Work with Next.js v12 HOT 3
- Getting 8 in front of each numbers. HOT 9
- Could not find a declaration file for module 'react-odometerjs' HOT 2
- Cannot read properties of undefined (reading 'odometer') HOT 8
- Next.js example is incorrect
- Getting error while running build
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from react-odometerjs.