kitbagjs / router

A type safe router for vuejs
https://router.kitbag.dev
MIT License
173 stars 4 forks source link

setup default rejection component for custom rejections #136

Closed stackoverfloweth closed 5 months ago

stackoverfloweth commented 5 months ago

I noticed that when a dev sets custom rejection type the options correctly will require a component for router options arg if passed but the whole options arg can be omited. That puts the dev in a position where rejections can happen but the user ends up at a blank screen.

This PR pivots from having a default NotFound component to a generic rejection component that supports both NotFound as well as any custom types the dev may define. Overriding this default component still works the same way, but components are always optional now that there is a default.

https://github.com/kitbagjs/router/assets/6098901/b183c58c-a441-47d2-a6f4-ce1bd14569a9

https://github.com/kitbagjs/router/assets/6098901/1c9188fc-5dcd-417e-b978-3c113c57fe62

netlify[bot] commented 5 months ago

Deploy Preview for kitbag-router ready!

Name Link
Latest commit 61850cb5e1f976b2c8ffbe5c0d80ae687a9e17c4
Latest deploy log https://app.netlify.com/sites/kitbag-router/deploys/662713ff9fb6830008f8e6c3
Deploy Preview https://deploy-preview-136--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.