Closed Confringe closed 5 months ago
I will take a look at this, however, you can use const scrollState = inject("scrollState");
and then watch scrollState if you want to do something on scroll
@Confringe I am closing this issue since there was never a response.
Hello, I'm currently trying to bind a reactive variable to the current scroll state, using lenis in a Nuxt 3 project. But for some reason it doesn't work as soon as I use that variable in another reactive context, e.g. display it to the user. When I simply print the variable in the console it works just fine. E.g. watch(somevar, ...) also doesn't work. I have investigated the issue further and found out, that the onscroll hook gets removed after the first function call, thus not only doesn't the variable get updated further, but the function doesn't get called at all. I have tried to manually set the hook after it has been removed, but it just gets removed again. I have boiled the issue down to the following minimal app.vue example:
I am using Nuxt 3.7.4 and nuxt-lenis 1.0.3. Some help would be much appreciated!