Comments (7)
Same issue and it actually just seems to completely freeze the page.
from react-fast-marquee.
from react-fast-marquee.
I tried that and it still doesn't work.
yeah i deleted my comment as it seemed to work but then actually just broke again. sorry for confusion.
from react-fast-marquee.
I had a quick look at the code and ran some tests and it looks like the issue is here:
react-fast-marquee/src/components/Marquee.tsx
Lines 189 to 191 in 8b4bf8b
This calculateWidth is being called over and over again. Each time it doubles the multiplier
.
I'm guessing this is because its adding new copies which changes the width and then the resize observer is called. This ends up creating thousands of copies which grinds the page to a halt.
from react-fast-marquee.
@timothygachengo I fixed it locally by cloning the poackage and changing that whole resize observer this
// Calculate width and multiplier on mount and on window resize
useEffect(() => {
if (!isMounted) return;
calculateWidth();
window.addEventListener("resize", calculateWidth);
return () => window.removeEventListener("resize", calculateWidth);
}, [calculateWidth, containerRef, isMounted]);
It's not as ideal as the original code as it will call calculateWidth more but it doesn't have the same issue of infinitely calling itself and breaking the page.
from react-fast-marquee.
I'm not sure if it works for nextjs, but you can try the answer described here: #66 (comment)
from react-fast-marquee.
Related Issues (20)
- when deploy on netlify getting error
- Please consider removing !important HOT 1
- z-index problem on marque
- Option to slow down sliding speed on mouse hover HOT 2
- Export Types
- How can I apply gradient color for both light and dark mode? HOT 3
- not working correctly when the dir='rtl' for the page HOT 2
- I am not able to make the children horizontally aligned, there should be a alignItems property in the props HOT 2
- img not displaying for first marquee cycle, only for the second cycle HOT 3
- Dynamically change speed when scrolling down or up
- Marquee throws an error in ESM projects HOT 2
- react-fast-markee should have an option to start with the text to the left without a gradient.
- Delay in autofill population
- Not load styles
- The vertical properties "up" and "down" are really difficult to use. HOT 1
- gradient property compatibility issues in Safari browser on Mac HOT 2
- Add ability to switch out parent container element for accessibility purposes
- Request Draggable Marquee HOT 3
- Data compatible
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-fast-marquee.