Skip to content
New issue

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

Extension not working on React #21

Open
2 tasks done
celsosa opened this issue Jun 22, 2023 · 1 comment
Open
2 tasks done

Extension not working on React #21

celsosa opened this issue Jun 22, 2023 · 1 comment
Labels
bug Something isn't working

Comments

@celsosa
Copy link

celsosa commented Jun 22, 2023

Checks

Version

0.4.1

Description

The Grid extension in React is not functioning as expected. The slide continues to operate like a standard slider, even with the extension.

Reproduction Link

No response

Steps to Reproduce

Trying something like this:

'use client'
import React from 'react';
import { Splide, SplideSlide } from '@splidejs/react-splide';
import { Grid } from '@splidejs/splide-extension-grid';
import '@splidejs/splide/dist/css/splide.min.css';

function CarouselGrid() {
    return (
        <Splide
        Extensions={{ Grid }}
            options={{
                type: 'loop',
                rewind: true,
                grid: {
                    dimensions: [[1, 1], [3, 1]], // For each slide, the first will be 1x1 and the rest will be 3x1
                    gap: {
                        row: '6px',
                        col: '6px',
                    },
                },
                perPage: 2,
                perMove: 1,
            }}

            className="flex w-full max-w-7xl justify-center"
        >

            <SplideSlide>
                <div className="flex flex-1 min-h-[120px]  items-center justify-center">test</div>

            </SplideSlide>
            <SplideSlide>
                <div className="flex flex-1 min-h-[120px] items-center justify-center">test</div>

            </SplideSlide>
            <SplideSlide>
                <div className="flex flex-1 min-h-[120px] items-center justify-center">test</div>

            </SplideSlide>
            <SplideSlide>
                <div className="flex flex-1 min-h-[120px] items-center justify-center">test</div>

            </SplideSlide>
            <SplideSlide>
                <div className="flex flex-1 min-h-[120px] items-center justify-center">test</div>

            </SplideSlide>
            <SplideSlide>
                <div className="flex flex-1 min-h-[120px] items-center justify-center">test</div>

            </SplideSlide>
        </Splide>
    );
}

export default CarouselGrid

I'm using this versions:
"@splidejs/react-splide": "^0.7.12",
"@splidejs/splide-extension-grid": "^0.4.1",

Expected Behaviour

The grid extension should make the grid works instead of showing just a normal slider(1 per page)

@celsosa celsosa added the bug Something isn't working label Jun 22, 2023
@ShahriarKh
Copy link

ShahriarKh commented Mar 21, 2024

use extensions instead of Extensions
https://splidejs.com/integration/react-splide/#migrating-from-v3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants