Skip to content

Usage with Next.js #19

Closed
Closed
@vaclav-zeman

Description

@vaclav-zeman

Hi, this issue is related to #9

I've got a Next.js app and currently use react-scroll-parallax on 2 separate pages (great library btw!). When you come to the page 1, the parallax works fine. But when you change route from here to the page 2, the parallaxes don't work (probably don't initialize).

The cause of the problem could be that in Next.js you cannot change or wrap the top-level component in your custom component (in this case ParallaxProvider). Basically the most "root" component (such as Layout) I can wrap is being unmounted on every route change.

Is there any workaround for this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions