UseScrollTrigger does not trigger on-page-reload in gatsby production page
See original GitHub issueUsing gatsby
witth gatsby-theme-material-ui
the useScrollTrigger
does not trigger on page reload when the page is build.
In dev mode the behavior differs as one reloads on the top of the page not in the middle.
const trigger = useScrollTrigger({ disableHysteresis: true, threshold: 50 });
When I am in the middle of the page and reload, the trigger should fire but it does not.
@material-ui/core": “^4.9.0 gatsby-theme-material-ui”: "^1.0.8 “gatsby”: “^2.15.24”,
Issue Analytics
- State:
- Created 3 years ago
- Comments:14 (14 by maintainers)
Top Results From Across the Web
UseScrollTrigger does not trigger on-page-reload in gatsby ...
Using gatsby witth gatsby-theme-material-ui the useScrollTrigger does not trigger on page reload when the page is build.
Read more >How to turn on and off the scroll trigger in Material UI ...
After spending more time on this issue, here is the solution that I came up with that works: import { useScrollTrigger } from ......
Read more >gatsby-plugin-material-ui
This is the plugin for Material-UI v5 (emotion). The plugin for v4 can be found here. Install. npm install gatsby-plugin-material ...
Read more >The Pitfall of Material UI Theme with Gatsby | In the Middle
Problem with SSR-ing of MUI Theme. Not so fast, in early iteration of this website, we find the following bug in the production...
Read more >ScrollTrigger issue with Gatsby - GSAP - GreenSock
The ScrollTrigger markers are misplaced when page loads, and might move (get more misplaced) on hard reloading page, depending on the current ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@oliviertassinari regarding 1) I am not an expert in template design, so maybe open a new discussion in a separate issue? And do a poll (thumbs up / down) or something 😃
regarding 2) Fair point 😉 maybe its just me being to lazy reading existing docs carefully 😉
@ohlr Last year, around this period, we have started to prioritize work on interoperability with Gatsby and more broadly, for people building static websites with React. While our effort starts to play-off: https://npm-stat.com/charts.html?package=gatsby-plugin-theme-ui&package=gatsby-plugin-material-ui, I feel we could still do better. The main chunk we have plan for this story is to provide a new theme outside of the box (in addition to the default Material Design one we have currently). Is there anything else you would like to see coming? New components, e.g. Scrollspy, etc ?