jossmac / react-scrolllock

🔒 Prevent scroll on the <body />
https://jossmac.github.io/react-scrolllock
MIT License
451 stars 41 forks source link

isActive is not delayed on load #84

Open JuicyRibs opened 3 years ago

JuicyRibs commented 3 years ago

There's a delay after loading the page before isActive is loaded. I set the isActive with a state called isLoading which is default as true but the scroll is not locked when the page loads but it is locked after about 500ms. In this code, while Dimmer is already active, ScrollLock is not


      <ScrollLock isActive={props.isLoading} />
      <Dimmer active={props.isLoading}>
        <Loader>Loading</Loader>
      </Dimmer>```
jossmac commented 2 years ago

Can you provide a reproduction?

rick-liruixin commented 9 months ago

They stopped the repairs. I had to do it myself, in the same way, with a new version of typeScript. And fix these problems for everyone to use. add react hooks、vue3 example

npm i body-scroll-lock-upgrade

repair log,Refer to the releases page.