epicweb-dev / rocket-rental

Rent Rockets from rocking awesome people
Other
277 stars 35 forks source link

use `dynamic-marquee-react` and pause on hover #5

Closed tjenkinson closed 10 months ago

tjenkinson commented 1 year ago

Hey @kentcdodds,

I mentioned in an email that I had a marquee library. Previously it was only JS but I've now got a react version created and decided to open a PR with it here.

I also added the feature you mentioned on a live stream where hovering now will temporarily pause the scrolling.

If you'd rather take a different approach or leave it as is that's fine. The act of getting this working has been a good exercise and I've squashed a lot of bugs in the process :)

kentcdodds commented 1 year ago

I noticed you have an id-generator thing. Does that server render properly? Normally if you generate IDs in React you need to use useId otherwise you get in situations where you have hydration mismatches.

tjenkinson commented 1 year ago

Yeh good point. It's only used inside useEffect though which I don't think would run for SSR(?), so it should be fine.

This does need JS to work (because it needs to know the width of the container to know how many elements would be needed to fill it). The SSR'd version will actually only render an empty div.

kentcdodds commented 10 months ago

Thanks! This project is no longer actively developed, so I'm going to close this.