Skip to content
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

Minor fixes or rejection route type guard and types in hook runner methods #261

Merged
merged 4 commits into from
Sep 9, 2024

Conversation

stackoverfloweth
Copy link
Contributor

while exploring the idea of "system" or "default" hooks to handle scroll position I found a couple bugs.

  • move isRejectionRoute out of createRouterReject, not used anyways
  • ensure that isRejectionRouteSymbol defaults to false when updating current route. We use Object.assign to update current route. All non-rejection routes do not have this property. The initial current route is a rejection route (not found). So the property is there when we create the router and never gets unset. So every route appeared to be a rejection route
  • we were taking T extends Routes on the hook runner methods but T was available from the parent function and wasn't being overridden.

Copy link

netlify bot commented Sep 8, 2024

Deploy Preview for kitbag-router ready!

Name Link
🔨 Latest commit 3aeedb5
🔍 Latest deploy log https://app.netlify.com/sites/kitbag-router/deploys/66ddf649b2848900085fae8e
😎 Deploy Preview https://deploy-preview-261--kitbag-router.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

src/services/createCurrentRoute.ts Outdated Show resolved Hide resolved
Co-authored-by: Craig Harshbarger <pleek91@gmail.com>
@stackoverfloweth stackoverfloweth merged commit 7ef75b8 into main Sep 9, 2024
7 checks passed
@stackoverfloweth stackoverfloweth deleted the isRejectionRoute-fixed branch September 9, 2024 01:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants