Closed truongnc1 closed 3 weeks ago
with code: import * as React from 'react'; import { Marquee } from 'dynamic-marquee-react';
import './style.css';
export default function App() { const [counter, setCounter] = React.useState(0); const [items, setItems] = React.useState([1]);
React.useEffect(() => { const timer = setInterval(() => setCounter((a) => a + 1), 1000); return () => clearInterval(timer); }, []);
return (
<Marquee rate={0} startOnScreen>
{items.map((item, index) => (
<div>{index}</div>
))}
</Marquee>
</div>
); }
item incorrect loop: 1 2 1 2 1 2. Please check for me!
Hi @truongnc1
I am not sure what you are trying to do. The code doesn't actually run at all, as you can see here: https://stackblitz.com/edit/github-qnyo2f?file=src%2Fapp.tsx
If you are able to share an example that shows your issue then I can help
this code not return: 1 2 1 2 1 2. with rate = 0?
The code you send doesn't run are you running something different?
But your problem might be that in the loop you're returning the index not the item
Sorry not really following. Would be great if you could provide an example on stackblitz? Could fork https://stackblitz.com/github/tjenkinson/dynamic-marquee/tree/master/demo?title=Dynamic%20Marquee%20Demo&file=src%2Fmain.ts