Skip to content

Calculate slide width immediately #17

Closed
@adiba

Description

@adiba

This line:

const [slideWidth, setSlideWidth] = useState<string | undefined>();

should instead be:

const [slideWidth, setSlideWidth] = useState(`${(slidesToShow > 1 ? 1 / slidesToShow : slidesToShow) * 100}%`);

to make use of server side rendering without layout shift.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions