404 or commonly known as page not found is must have for any web app. How do we setup theπ route and manage the error page ?
Build a beautiful π§ error component with π animation.
This example uses solid-app-router , let's setup a router with wild card in App.jsx
<Route path="*" element={() => <PageNotFound />} />
Here the path can be anything which doesn't exists, such as /download , /faq etc and the PageNotFound is just another page component.
When you hit http://localhost:3000/faq the PageNotFound will render if the route is not defined.
0 comments:
Post a Comment