{"id":15893234,"url":"https://github.com/liuhong1happy/similar-react-native-router","last_synced_at":"2026-05-05T21:35:11.205Z","repository":{"id":57359657,"uuid":"72343058","full_name":"liuhong1happy/similar-react-native-router","owner":"liuhong1happy","description":"similar react-native-router","archived":false,"fork":false,"pushed_at":"2017-03-12T12:37:13.000Z","size":183,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-04-26T08:20:56.484Z","etag":null,"topics":["react","react-native","react-native-router","react-router","similar-react-native-router"],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/liuhong1happy.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}},"created_at":"2016-10-30T10:37:25.000Z","updated_at":"2017-03-12T14:38:58.000Z","dependencies_parsed_at":"2022-09-06T21:41:18.203Z","dependency_job_id":null,"html_url":"https://github.com/liuhong1happy/similar-react-native-router","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuhong1happy%2Fsimilar-react-native-router","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuhong1happy%2Fsimilar-react-native-router/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuhong1happy%2Fsimilar-react-native-router/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/liuhong1happy%2Fsimilar-react-native-router/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/liuhong1happy","download_url":"https://codeload.github.com/liuhong1happy/similar-react-native-router/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246863616,"owners_count":20846287,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-native","react-native-router","react-router","similar-react-native-router"],"created_at":"2024-10-06T08:09:11.348Z","updated_at":"2026-05-05T21:35:06.156Z","avatar_url":"https://github.com/liuhong1happy.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# similar-react-native-router\n\nsimilar react-native-router\n\n## 安装\n\n\tnpm install --save similar-react-native-router\n\t\n## 用法\n\n```js\n\nimport {Router,Route,Link,RouteHistory} from 'similar-react-native-router';\n\nvar RouterApp = ()=\u003e{\n\treturn (\u003cRouter defaultRoute=\"/home/index\" path=\"/\" component={MainApp}\u003e\n\t\t\t\t\t\u003cRoute component={HomeView} path=\"home\"\u003e\n\t\t\t\t\t\t\t\u003cRoute component={HomeIndexView} path=\"index\"\u003e\u003c/Route\u003e\n\t\t\t\t\t\t\t\u003cRoute component={HomeListView} path=\"list/:subject\"\u003e\u003c/Route\u003e\n\t\t\t\t\t\t\t\u003cRoute component={HomeDetails} path=\"details/:id\"\u003e\u003c/Route\u003e\n\t\t\t\t\t\u003c/Route\u003e\n\t\t\t\t\u003c/Router\u003e)\n}\n```\n\n## API\n\n- Router 定义根路由，指定defaultRoute(默认路由)\n    - path 路由名称，这里指定为\"/\" `String`\n    - component 路由对应的组件 `React.Component`\n    - defaultRoute 默认路由 `String`\n- Route 定义路由，可包含子路由，允许定义[:id]格式路由，默认允许传递[?id=xxx]方式\n    - path 路由名称，这里指定为\"/\" `String`\n    - component 路由对应的组件 `React.Component`\n    - children 子路由 `Array\u003cRoute\u003e or \u003cRoute\u003e`\n- Link 简单路由链接\n    - name 跳转到的路由名称 `String`\n    - onPress 路由点击回调函数，内部已经实现路由跳转 `Function`\n\t- config 跳转动画方式 `Navigator.SceneConfigs`\n- RouteHistory 路由操纵，注意以下是属性或者方法，非props。\n    - pushRoute 修改当前路由，不适合后退页面，适合平行页面之间跳跃 `Function(name,index,config)`\n\t- resetToRoute 重置route，适合首次初始化的时候，例如登录应用过后 `Function(name,index,config)`\n\t- popRoute 后退到上一级 `Function`\n\t- popToRoute 后退多级 `Function(name)`\n    - curHash 当前路由 `String`\n\t\n\n## 特点\n\n1. similar-react-native-router采用ES6写法。\n\n2. 高度模仿react-router组件，采用Navigator实现，使用便捷。\n\n## 联系方式\n\nEmail: [liuhong1happy](liuhong1.happy@163.com)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliuhong1happy%2Fsimilar-react-native-router","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fliuhong1happy%2Fsimilar-react-native-router","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fliuhong1happy%2Fsimilar-react-native-router/lists"}