{"id":25621090,"url":"https://github.com/kruceo/milhas","last_synced_at":"2026-05-06T02:34:36.060Z","repository":{"id":155250487,"uuid":"613560106","full_name":"Kruceo/Milhas","owner":"Kruceo","description":"React router, control specific path conditions to render.","archived":false,"fork":false,"pushed_at":"2023-07-12T12:09:37.000Z","size":557,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-07T02:50:30.363Z","etag":null,"topics":["preact","preact-router","react","react-router","router"],"latest_commit_sha":null,"homepage":"https://www.kruceo.com","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Kruceo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-03-13T20:11:03.000Z","updated_at":"2023-12-05T16:14:19.000Z","dependencies_parsed_at":null,"dependency_job_id":"201c0b11-9357-4b13-95d6-1e7b469a8091","html_url":"https://github.com/Kruceo/Milhas","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Kruceo/Milhas","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kruceo%2FMilhas","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kruceo%2FMilhas/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kruceo%2FMilhas/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kruceo%2FMilhas/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Kruceo","download_url":"https://codeload.github.com/Kruceo/Milhas/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Kruceo%2FMilhas/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32676395,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-06T02:33:58.958Z","status":"ssl_error","status_checked_at":"2026-05-06T02:33:39.611Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["preact","preact-router","react","react-router","router"],"created_at":"2025-02-22T08:34:02.559Z","updated_at":"2026-05-06T02:34:36.055Z","avatar_url":"https://github.com/Kruceo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n\u003cimg width=\"128px\" height=\"128px\" src=\"icon.png\" alt=\"icon\"\u003e\n\n\u003c/div\u003e\n\n# **Milhas**\n\n## **Introduction**\n\nMilhas is a router specifically designed for developing Single-Page Applications (SPAs) with React. It provides an easy and efficient way to manage navigation within a React application, allowing developers to create dynamic and responsive user experiences.\n\n## **Components**\n\n### **Router**\n\nThe router acts as a container for all the navigation-related components and manages the navigation within the application.\n\n### **Path**\n\nThe `Path` component is used to define a specific path within the application. It can be used with the `as` prop to specify the path that should match. Additionally, it supports an optional `absolute` prop.\n\n- The `as` prop is used to define the path pattern that should match. It can include static segments and placeholders for dynamic values. Placeholders are denoted by a `:` symbol followed by a variable name, such as `:id`. These placeholders can capture dynamic values from the URL.\n\n- The `absolute` prop, when set to `true`, requires an exact match of the path. If the `absolute` prop is not used or set to `false`, the path will match partially. This means that a path with placeholders can match a URL with additional segments before or after the placeholder value.\n\n### **Anchor**\n\nThe `Anchor` component represents a hyperlink within the application. It can be used to navigate to different paths or perform other actions when clicked.\n\n### **Redirect**\n\nThe `Redirect` component automatically redirects the user to another path when rendered.\n\n### **E404**\n\nThe `E404` component is rendered when none of the defined paths match the current URL. It serves as an error page or a fallback component. Inside this component, you can define the content to be displayed when a route is not found.\n\n## **Example**\n\n```tsx\n\u003cRouter\u003e\n  \u003cPath as=\"/home\"\u003e\n    \u003cp\u003e\n    This accepts any path that starts with \"home\".\n    Ex: \"/home/any/other/path\" will match!\n   \u003c/p\u003e\n  \u003c/Path\u003e\n\n  \u003cPath as=\"/about\" absolute\u003e\n    \u003cp\u003e\n    Because of the \"absolute\" attribute, this will only match the exact \"/about\" path.\n    Ex: \"/about/any/other\" will not match, \n    but just \"/about\" will match.\n    \u003c/p\u003e\n  \u003c/Path\u003e\n\n  \u003cPath as=\"/product/:id\" absolute\u003e\n    \u003cp\u003e\n    This will match any \"product\" path with another path to follow, like \"/products/123\".\n    Ex: \"/product/255\" will match.\n    \u003c/p\u003e\n  \u003c/Path\u003e\n\n  \u003cE404\u003e\n    \u003cp\u003eThis page will be rendered if any other path does not match the URL path.\u003c/p\u003e\n  \u003c/E404\u003e\n\u003c/Router\u003e\n```\n\n\u003ca href=\"https://kruceo.com\"\u003eKruceo website\u003c/a\u003e is built with Milhas.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkruceo%2Fmilhas","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkruceo%2Fmilhas","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkruceo%2Fmilhas/lists"}