We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The following example results in style="animation-duration: 0s;" even after some children are finally rendered.
style="animation-duration: 0s;"
import React, {useEffect, useState} from 'react'; const Component = () => { const [items, setItems] = useState([]); useEffect(() => { const timer = setTimeout(() => { setItems([{id: 1, text: 'abcde'}, {id: 2, text: 'fghij'}]); }, 1000); return () => clearTimeout(timer); }, []); return ( <div style={{height: '50px'}}> <Marquee> { items.map(item => ( <div key={item.id}>{item.text}</div> )) } </Marquee> </div> ); };
Workaround: add a key prop to the Marquee which reflects changes in items count.
key
Marquee
items
Upd.: seems that we may just add children as a dependency here: https://github.com/mxmzb/react-marquee-slider/blob/master/src/Marquee.tsx#L97 This should also allow to automatically adjust animation speed if the content changes.
children
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The following example results in
style="animation-duration: 0s;"
even after some children are finally rendered.Workaround: add a
key
prop to theMarquee
which reflects changes initems
count.Upd.: seems that we may just add
children
as a dependency here: https://github.com/mxmzb/react-marquee-slider/blob/master/src/Marquee.tsx#L97 This should also allow to automatically adjust animation speed if the content changes.The text was updated successfully, but these errors were encountered: