Skip to content

V5 SSR Compatability #507

Open
Open
@somespecialone

Description

Hi! Thank for your work! I see, that some people frustrated with window is not defined problem. I also counter this. I making Vue wrapper library for your great project. Next lines makes headache:

const defaultLenisOptions: ILenisOptions = {
    wrapper: window,
    content: document.documentElement,
    // ...
}

https://github.com/locomotivemtl/locomotive-scroll/blob/v5-beta/src/index.ts#L18-L19

Actually, I didn't get for what there is default lenis options if lenis constructor method has same defaults? Moreover, all values from
defaultLenisOptions will be overrriden there:

Object.assign(this, {
     lenisOptions,
     // ....
})

https://github.com/locomotivemtl/locomotive-scroll/blob/v5-beta/src/index.ts#L78C1-L79C26

Unfortunately I can't dynamic import file.
So, I just propose and ask to remove wrapper and content fields from defaultLenisOptions object, as it will solve my and others problem.
Can I open a PR?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions