Open ghost opened 2 years ago
@qlaffont-flexper were you able to solve this?
Unfortunately no. Finally i remove the library :/
anyone find a solution to this?
@qlaffont did you find an alternative that works with next?
Finally I used a CSS ticker :
<div style={{ overflow: isScrollable ? 'hidden' : 'initial' }} ref={blockRef}>
<div className={clsx(isScrollable ? 'ticker' : '', ' text-white')} style={{ animationDuration: `15s` }}>
<p style={{ paddingRight: '0.5em', whiteSpace: 'nowrap' }} className="ticker_item" ref={ref}>
{text}
</p>
</div>
</div>
@keyframes ticker {
0% {
-webkit-transform: translateX(100%);
transform: translateX(100%);
visibility: visible;
}
100% {
-webkit-transform: translateX(-100%);
transform: translateX(-100%);
}
}
$duration: 30s;
.ticker {
display: inline-block;
white-space: nowrap;
padding-right: 100%;
box-sizing: content-box;
-webkit-animation-iteration-count: infinite;
animation-iteration-count: infinite;
-webkit-animation-timing-function: linear;
animation-timing-function: linear;
-webkit-animation-name: ticker;
animation-name: ticker;
-webkit-animation-duration: $duration;
animation-duration: $duration;
&__item {
display: inline-block;
font-size: 2rem;
}
}
FYI I had exactly the same issue on my Next.js build so I swapped it with this package react-fast-marquee. Works well and the code markup is much cleaner.
I hope that helps somebody else having issues here.
I ended up doing the same, works great.
FYI I had exactly the same issue on my Next.js build so I swapped it with this package react-fast-marquee. Works well and the code markup is much cleaner.
I hope that helps somebody else having issues here.
@JoolianGarcia @hongweitang @qlaffont @CruiseDevice @reedislost It looks like this library is not working with React 18 at the moment. I found a simple solution and I created a library to make it working: https://github.com/cyntler/render-with-react17.
You can install the library with npm i render-with-react17
and then use it in this way:
import Ticker from 'react-ticker';
import { RenderWithReact17 } from 'render-with-react17';
<RenderWithReact17>
<Ticker
mode="await"
speed={10}
direction="toLeft"
offset="run-in"
>
{() => <p>{description}</p>}
</Ticker>
</RenderWithReact17>
@cyntler Your. solution is not working. Because Ticker can't be loaded. It gives Ticker error.
@melih10 Can you provide more informations about error and show your code?
Hello,
I want to use your Component in a project.
But when I want to use it, it tells me that I have reach Maximum update. It happend only when I use your Component and I check render without your library (only 2 render).
Errors :
Code :
Package.json :
Thanks for your help ! ^^