{"id":26666463,"url":"https://github.com/ilikepizza2/react-savestate","last_synced_at":"2026-06-19T06:32:43.183Z","repository":{"id":224908376,"uuid":"764559745","full_name":"Ilikepizza2/react-savestate","owner":"Ilikepizza2","description":"A minimal routing solution for routing in react which saves the state across route changes and prevents hard refreshes","archived":false,"fork":false,"pushed_at":"2024-02-28T17:07:58.000Z","size":12,"stargazers_count":2,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-11-01T07:19:20.705Z","etag":null,"topics":["react","react-routing","routing","state-management"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/react-savestate","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Ilikepizza2.png","metadata":{"files":{"readme":"readme.md","changelog":null,"contributing":null,"funding":null,"license":null,"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}},"created_at":"2024-02-28T09:53:03.000Z","updated_at":"2024-04-09T07:14:02.000Z","dependencies_parsed_at":"2024-02-28T17:14:36.722Z","dependency_job_id":"aa2e848a-cfae-4511-909d-bbab9704576b","html_url":"https://github.com/Ilikepizza2/react-savestate","commit_stats":null,"previous_names":["ilikepizza2/react-statesafe","ilikepizza2/react-savestate"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Ilikepizza2/react-savestate","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ilikepizza2%2Freact-savestate","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ilikepizza2%2Freact-savestate/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ilikepizza2%2Freact-savestate/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ilikepizza2%2Freact-savestate/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ilikepizza2","download_url":"https://codeload.github.com/Ilikepizza2/react-savestate/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ilikepizza2%2Freact-savestate/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34520431,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-19T02:00:06.005Z","response_time":61,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["react","react-routing","routing","state-management"],"created_at":"2025-03-25T18:35:12.893Z","updated_at":"2026-06-19T06:32:43.156Z","avatar_url":"https://github.com/Ilikepizza2.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n\n**REACT-SAVESTATE**\n\n\n**Description:** react-savestate is a lightweight npm package designed as a router for React applications which preserves states between route changes. It provides alternative routing functionalities and components to streamline navigation within React-based web applications.\n\n**Installation:** You can install react-savestate via npm by running the following command:\n\n\n\n```bash\n npm install react-savestate\n ```\n\n**Usage:**\n\n```javascript\n// import the functions\nimport { Route, getState, Link } from 'react-savestate';\n```\n```javascript\n// Define routes using the Route component\n\u003cRoute path='/' component={LandingPage} /\u003e\n\u003cRoute path='/Contact' component={Contact} /\u003e\n```\n```javascript\n// Use the Link component for navigation without page refresh\n\u003cLink href='/' state={{ data: \"from HomePage\", data2: \"something else\" }}\u003eGo to contact\u003c/Link\u003e\n```\n```javascript\n// Retrieve saved state using getState function\nconsole.log(getState());\n```\n\n**Components:**\n\n-   **Route:** An alternative route element for routing between pages in a React application. No need to wrap them in any parent wrapper.\n-   **Link:** A replacement for `\u003ca\u003e` tag which facilitates navigation without triggering a page refresh. It also supports passing a state object to preserve data across routes without using URL parameters.\n-   **getState:** Function to retrieve the saved state, if any, within the application.\n\n\n\n**Note:**\n\n-   Ensure that the state passed to Link is serializable to avoid any issues with preservation and retrieval.\n-   Utilize Route and Link components as replacements for traditional routing and navigation elements within your React application for improved performance and user experience.\n\n**Contributing:** Contributions to react-savestate are welcome! Feel free to submit issues or pull requests on the GitHub repository: react-savestate GitHub Repository\n\n**License:** This project is licensed under the MIT License - see the LICENSE file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filikepizza2%2Freact-savestate","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Filikepizza2%2Freact-savestate","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Filikepizza2%2Freact-savestate/lists"}