Skip to content

Releases: richardscarrott/react-snap-carousel

v0.5.0

20 Sep 15:56
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.4.1...v0.5.0

v0.5.0-next.1

17 Sep 08:25
Compare
Choose a tag to compare
v0.5.0-next.1 Pre-release
Pre-release

What's Changed

New Contributors

Full Changelog: v0.5.0-next.0...v0.5.0-next.1

v0.5.0-next.0

17 Sep 08:21
Compare
Choose a tag to compare
v0.5.0-next.0 Pre-release
Pre-release

What's Changed

Full Changelog: v0.4.1...v0.5.0-next.0

v0.4.1

03 Sep 11:43
Compare
Choose a tag to compare

What's Changed

  • Prevent iOS <= 14 from blowing up when reading scroll margin or padding by @richardscarrott in #26

Full Changelog: v0.4.0...v0.4.1

v0.4.1-next.0

23 Aug 15:21
Compare
Choose a tag to compare
v0.4.1-next.0 Pre-release
Pre-release

What's Changed?

  • Prevent iOS <= 14 from blowing up when reading scroll margin or padding.

Full Changelog: v0.4.0...v0.4.1-next.0

v0.4.0

20 Jan 18:25
Compare
Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.3.2...v0.4.0

v0.3.2

15 May 17:19
Compare
Choose a tag to compare

What's Changed

  • Prevent useLayoutEffect from warning during SSR

v0.3.1

16 Feb 16:30
Compare
Choose a tag to compare

What's Changed

  • Add options.initialPages to allow SSR to render pages when known up front (e.g. there is only 1 item per page).

v0.3.0

14 Feb 13:58
Compare
Choose a tag to compare

What's Changed

  • Add support for scroll padding & scroll margin #3

v0.2.0

02 Feb 16:23
Compare
Choose a tag to compare

What's Changed

  • Snap point CSS declarations (scroll-snap-align: start) are no longer applied automatically. This means by default, a carousel will not snap to a page. #6

    • Instead a Set of item indexes called snapPointIndexes is provided to allow carousels to render snap points themselves. This change was necessary to ensure DOM updates are only performed by React.

      Before

      const Carousel = () => {
        const { scrollRef } = useSnapCarousel();
        return (
          <ul ref={scrollRef}>
            {Array.from({ length: 16 }).map((item) => (
              <li>{item}</li>
            ))}
          </ul>
        );
      };

      After

      const Carousel = () => {
        const { scrollRef, snapPointIndexes } = useSnapCarousel();
        return (
          <ul ref={scrollRef}>
            {Array.from({ length: 16 }).map((item, i) => (
              <li
                style={{
                  scrollSnapAlign: snapPointIndexes.has(i) ? 'start' : ''
                }}
              >
                {item}
              </li>
            ))}
          </ul>
        );
      };