-
Notifications
You must be signed in to change notification settings - Fork 30
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(fix) Breaking changes in Gatsby 3.0 #60
Conversation
you save my day <3, works fine for v4 |
You save my day too, thank you! |
@loke-dev could you add a TypeScript definition file please? |
@ajmeese7 I think that lies more on @lsirivong to implement in the package, but it seems like this is abandoned. I'm sorry but I'm not doing any features on this, I only published a hotfix so I (and others) could keep using this package. |
Sounds good, I'll work on a TS fix when I have the time |
I also made a similar fork but I've already converted the legacy
I'm curious tho that if this is really already abandoned, can I alter the author details as I make more changes moving forward? Looks like @lsirivong is not gonna be responding anytime soon. Even this PR was made over a year ago now. UPDATE: I'm excited to announce that I've successfully exposed const [modal, closeTo] = useModalRouting({
modalProps: {
contentLabel: "Custom content label",
onAfterOpen: () => {
console.log("onAfterOpen")
},
closeTimeoutMS: 300,
style: { overlay: {}, content: {} },
id: "some-id",
onRequestClose: () => {}, // would error, is an internal-exclusive prop
},
})
//..
return (
<div>
{modal ? (
<Link to={closeTo}>Close</Link>
) : (
<header className="mb-2">
<h1>Website Title</h1>
</header>
)}
<h2>Modal Page</h2>
<Link to="/">Go back to the homepage</Link>
</div>
) This way, the As always, please do point out if there's a better way, but this I think is the cleanest API to go, since it aligns with React's hook concept. Let me know what ya'll think! |
@lsirivong please release this if you get a chance 🙏 having to use the temporary package |
😞 |
This PR fixes #57
If you want to use these changes before this has been merged you can find the fork here:
https://www.npmjs.com/package/gatsby-plugin-modal-routing-3