justin-chu / react-fast-marquee

A lightweight React component that harnesses the power of CSS animations to create silky smooth marquees.
https://react-fast-marquee.com
MIT License
1.23k stars 98 forks source link

Marquee doesn't work if used twice on a page #52

Closed Aycom366 closed 1 year ago

Aycom366 commented 2 years ago

marquee doesn't work if it is being used twice on a page.

<div className='w-full h-full'>
        <Marquee speed={300}>
          <div className='w-full  flex gap-2 relative'>
            {TwitterApi.splice(0, 10).map((item, index) => (
              <TwitterCard classes='last:mr-2' {...item} key={index} />
            ))}
          </div>
        </Marquee>
      </div>

The above is working normally but if I added extra elements to the above, it doesn't show.

<div className='w-full h-full'>
        <Marquee speed={300}>
          <div className='w-full  flex gap-2 relative'>
            {TwitterApi.splice(0, 10).map((item, index) => (
              <TwitterCard classes='last:mr-2' {...item} key={index} />
            ))}
          </div>
        </Marquee>
      </div>
      <div className='w-full h-full'>
        <Marquee speed={300}>
          <div className='w-full  flex gap-2 relative'>
            {TwitterApi.splice(0, 10).map((item, index) => (
              <TwitterCard classes='last:mr-2' {...item} key={index} />
            ))}
          </div>
        </Marquee>
      </div>
justin-chu commented 1 year ago

Sorry, I'm unable to reproduce this, closing for now

anistark commented 1 year ago

Happening for me too. How to fix it ? @Aycom366 @justin-chu