Comments (9)
Hi folks, this has shipped in 1.2.0.
from gatsby-plugin-modal-routing.
@machineghost I've forked this repo, fixed current bug and shipped as npm pack, so you can use https://www.npmjs.com/package/gatsby-plugin-modal-routing-v2 for temporary purposes, after #50 will be done I will be back to this repo
from gatsby-plugin-modal-routing.
@lsirivong Hi,
As I debugged
const shouldUpdateScroll = ({
prevRouterProps: { location: prevLocation },
routerProps: { location }
}) => {
prevRouterProps
is not object and when you try to destruct it, it throws runtime exception, it happens after upgrading gatsby to latest version.
from gatsby-plugin-modal-routing.
Hi @shavidzet, I commented on that PR as well, but could you help me understand what the issue is that this PR fixes? As far as I can tell, it is just removing a reference to an unused variable. I'm not able to see how that addresses an issue.
from gatsby-plugin-modal-routing.
That's why I forked your repo and made same change (shavidzet@cf8ded3#diff-7e8a5eb2ef2dc38a4825df48a18d4fc9L4) recently was made in #50
from gatsby-plugin-modal-routing.
I assume this fixes the following?
shouldUpdateScroll.js:11 Uncaught TypeError: Cannot read property 'location' of undefined at Object.shouldUpdateScroll (shouldUpdateScroll.js:11) at api-runner-browser.js:35 at Array.map (<anonymous>) at ./.cache/api-runner-browser.js.exports.apiRunner (api-runner-browser.js:22) at ScrollHandler.shouldUpdateScroll (navigation.js:119) at ScrollHandler._this.shouldUpdateScroll (scroll-handler.js:67) at ScrollHandler._this.windowScroll (scroll-handler.js:46) at ScrollHandler.componentDidMount (scroll-handler.js:87) at ScrollHandler.componentDidMount (react-hot-loader.development.js:704) at commitLifeCycles (react-dom.development.js:19815) at commitLayoutEffects (react-dom.development.js:22804) at HTMLUnknownElement.callCallback (react-dom.development.js:189) at Object.invokeGuardedCallbackDev (react-dom.development.js:238) at invokeGuardedCallback (react-dom.development.js:293) at commitRootImpl (react-dom.development.js:22542) at unstable_runWithPriority (scheduler.development.js:653) at runWithPriority$1 (react-dom.development.js:11040) at commitRoot (react-dom.development.js:22382) at finishSyncRender (react-dom.development.js:21808) at performSyncWorkOnRoot (react-dom.development.js:21794) at scheduleUpdateOnFiber (react-dom.development.js:21189) at updateContainer (react-dom.development.js:24374) at react-dom.development.js:24759 at unbatchedUpdates (react-dom.development.js:21904) at legacyRenderSubtreeIntoContainer (react-dom.development.js:24758) at render (react-dom.development.js:24841) at app.js:94
If so @lsirivong please merge! I just tried to use the library today and ran into this.
from gatsby-plugin-modal-routing.
I tried using that package, and it does make things work, but when I click my Links (either Gatsby ones with state={{modal: true}}
, or ones imported from your package with asModal
) ... they just act as ordinary links, and take me to my modal as a separate page.
Since I've never used the library before I'm not sure if this is a separate issue or a side effect of your fix.
P.S. My dialog page/file is a carbon copy of the example one on the GitHub documentation (just with a different name).
from gatsby-plugin-modal-routing.
from gatsby-plugin-modal-routing.
I tried using that package, and it does make things work, but when I click my Links (either Gatsby ones with
state={{modal: true}}
, or ones imported from your package withasModal
) ... they just act as ordinary links, and take me to my modal as a separate page.Since I've never used the library before I'm not sure if this is a separate issue or a side effect of your fix.
P.S. My dialog page/file is a carbon copy of the example one on the GitHub documentation (just with a different name).
Probably it's related with my fix, because I've deleted prevRouteProps
usage in shavidzet@cf8ded3#diff-7e8a5eb2ef2dc38a4825df48a18d4fc9L4 and probably prevRouteProps
is necessary to stay on same page after opening modal.
Please provide your code on https://codesandbox.io/
from gatsby-plugin-modal-routing.
Related Issues (20)
- Animate on closing modal HOT 3
- Hooks not working inside modal - Most likely breaks my Context.Provider HOT 1
- Open specific route always in modal HOT 1
- Doesn't work with TransitionLink HOT 5
- Is there a way to navigate to next/prev modals as in the gatsbygram example? HOT 1
- Provide an example for using custom CSS classes HOT 2
- Background scrolls while modal is open HOT 2
- Different Result on gatsby develop vs. build HOT 4
- Page is not rendered as modal when refreshed. HOT 2
- Transition between modals HOT 3
- No Way to Style Modal or Use a Different Modal HOT 16
- Code Splitting
- Needs an update for supporting gatsby v3 HOT 2
- Close To with parameters
- Always `false` + different props than docs HOT 8
- Has anyone tested this in react testing library?
- A context consumer was rendered with multiple children error HOT 1
- Support for Gatsby 4.0 HOT 8
- I faced same problem, how can we use this plugin within Gatsby v4?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gatsby-plugin-modal-routing.